How Image Producers and Image Consumers Interact

Somehow, one or more image consumers are registered with a single image producer. Typically, this happens behind the scenes—unless you are filtering images or grabbing pixels, you rarely deal with image consumers directly.

At some point in time, the image producer invokes the image consumer's setDimensions(). Optionally, producers may invoke setHints() and setColorModel() to further inform consumers as to the properties of the image it is about to deliver.

Once production of the image starts, producers invoke one of the consumer's overloaded setPixels(). setPixels() may be called once, therefore delivering the entire image in one shot, or it may be called multiple times with regions of the image ...

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.