Implementing the ImageConsumer Interface

As was previously mentioned in “The ImageProducer Interface”, image producers can have more than one image consumer added to them. Each image consumer registered with an image producer is passed the pixels of the image associated with the producer whenever the bits of the image are reconstructed. In this section, we will explore two subjects: implementing the ImageConsumer interface directly and registering an image consumer with an image producer.

An Image Dissolver

A dissolve filter, such as those implemented in “DissolveFilter” and “A Dissolve Filter That Extends ImageFilter”, becomes much more interesting when used to animate an image by fading it in and out. This section presents a dissolver—an implementation ...

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.