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, ...
Get Graphic Java™ 1.2, Volume I: AWT, Third Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.