开发者

How to use Java and NetBeans to display data as an image

开发者 https://www.devze.com 2022-12-20 21:35 出处:网络
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 b

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.

  1. Creating a java Image object from an array: Turn an array of pixels into an Image object with Java's ImageIO?

  2. 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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号