views:

71

answers:

3

I am new to Java and NetBeans but have experience in C/C++. I will be working on an application which will have an area to display an image. The image will be created in memory as an array of unsigned bytes and considered to be monochrome.

I'm looking for a tutorial or examples of displaying data like this as an image. (The data will be read from an imaging radiometer - every few seconds) I've looked at some classes in AWT but I need an example.

Thanks

+1  A: 

Have a look at Trail: 2D Graphics and BufferedImage.

Jonas
+1  A: 

Here's a very simple example of manipulating the pixels of an off-screen image directly. This more complex example examines several approaches to accumulating image data in a separate thread and viewing periodic updates.

trashgod
A: 

It looks like you have two problems.

  1. Creating a java Image object from an array: http://stackoverflow.com/questions/124630/turn-an-array-of-pixels-into-an-image-object-with-javas-imageio

  2. Displaying the java Image: http://stackoverflow.com/questions/299495/java-swing-how-to-add-an-image-to-a-jpanel

More info on rendering with a JPanel can be found here: http://java.sun.com/docs/books/tutorial/uiswing/painting/index.html

bcash