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 i开发者_C百科mage. (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
Have a look at Trail: 2D Graphics and BufferedImage.
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.
It looks like you have two problems.
Creating a java Image object from an array: Turn an array of pixels into an Image object with Java's ImageIO?
Displaying the java Image: 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
精彩评论