O'Reilly logo

Graphic Java™ 1.2, Volume I: AWT, Third Edition by David M. Geary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Memory Image Source

In addition to supporting grabbing pixels from an existing image, the AWT image package provides a mechanism for converting an array of pixels into an image. java.awt.image.MemoryImageSource implements the ImageProducer interface and can produce the bits of an image from an array of pixels.

Like PixelGrabber, the MemoryImageSource class is provided as a convenience that allows construction of an image without the need for having to implement custom image filters.

MemoryImageSource provides no less than six constructors that take the following arguments:

 (int w, int w, ColorModel cm, byte[] pixels, int offset, int scansize) (int w, int w, ColorModel cm, byte[] pixels, int offset, int scansize, Hashtable properties) (int w, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required