PixelGrabber
Class PixelGrabber
- java.lang.Object
-
- java.awt.image.PixelGrabber
- All Implemented Interfaces:
- ImageConsumer
public class PixelGrabber extends Object implements ImageConsumer
The PixelGrabber class implements an ImageConsumer which can be attached to an Image or ImageProducer object to retrieve a subset of the pixels in that image. Here is an example:
public void handlesinglepixel(int x, int y, int pixel) { int alpha = (pixel >> 24) & 0xff; int red = (pixel >> 16) & 0xff; int green = (pixel >> 8) & 0xff; int blue = (pixel ) & 0xff; // Deal with the pixel as necessary... }