Summary

The AWT image package provides a number of different ways to manipulate images in addition to implementing filters. Images can be scaled on the fly by use of using the Graphics class, or a scaled representation of an image can may be obtained by invocation of invoking Image.getScaledInstance().

Pixels can may be grabbed from an image, and grabbed pixels can may be turned into an image. You can then implement image Image filters then can be implemented that never involve the image filtering classes at all—simply grab all the pixels you need, modify them, and use MemoryImageSource to convert them into another image.

Even animations can be implemented rather painlessly with the animation capabilities of the MemoryImageSource class.

Support ...

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.