4
Contributors
3
Replies
7
Views
4 Years
Discussion Span
Last Post by radhakrishna.p
0

You probably want a java.awt.image.BufferedImage. It has a method called getRGB which can give you the color of any pixel. If you have any other kind of java.awt.Image then you can start by constructing a BufferedImage of the same size. I'll call it bImage. Then you can call bImage.getGraphics() to allow you to draw your image onto bImage.

Don't forget to call dispose() on your graphics object, and be aware that not all Image objects are fully ready to be drawn. You may need to use an java.awt.image.ImageObserver or some other technique to wait for the image to be ready.

1

suggegtion only :

PixelGrabber is also another class where we can get image data in a pixel by pixel manner

Edited by radhakrishna.p: giving clarity on the solution

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.