img
Images
T
his chapter examines the AWT's Image class and the java.awt.image package. Together,
they provide support for imaging (the display and manipulation of graphical images).
An image is simply a rectangular graphical object. Images are a key component of web
design. In fact, the inclusion of the <img> tag in the Mosaic browser at NCSA (National Center
for Supercomputer Applications) is what caused the Web to begin to grow explosively in 1993.
This tag was used to include an image inline with the flow of hypertext. Java expands upon
this basic concept, allowing images to be managed under program control. Because of its
importance, Java provides extensive support for imaging.
Images are objects of the Image class, which is part of the java.awt package. Images are
manipulated using the classes found in the java.awt.image package. There are a large number
of imaging classes and interfaces defined by java.awt.image, and it is not possible to examine
them all. Instead, we will focus on those that form the foundation of imaging. Here are the
java.awt.image classes discussed in this chapter:
CropImageFilter
Memor yImageSource
FilteredImageSource
PixelGrabber
ImageFilter
RGBImageFilter
These are the interfaces that we will use:
ImageConsumer
ImageObser ver
ImageProducer
Also examined is the MediaTracker class, which is part of java.awt.
File Formats
Originally, web images could only be in GIF format. The GIF image format was created by
CompuServe in 1987 to make it possible for images to be viewed while online, so it was well
suited to the Internet. GIF images can have only up to 256 colors each. This limitation caused
the major browser vendors to add support for JPEG images in 1995. The JPEG format was
created by a group of photographic experts to store full-color-spectrum, continuous-tone
Search WWH :
Custom Search
Previous Page
Java SE 6 Topic Index
Next Page
Java SE 6 Bookmarks
Home