GrayImagepublic class GrayImage extends Applet An applet that display an image, and a filtered version of the image |
Fields Summary |
---|
Image | orig | Image | gray |
Methods Summary |
---|
public void | init()Load the image. Create a new image that is a grayer version of it, using
a FilteredImageSource, ImageProducer and a the GrayFilter class, below.
orig = this.getImage(this.getDocumentBase(), "cover.gif");
ImageFilter filter = new GrayFilter();
ImageProducer producer = new FilteredImageSource(orig.getSource(), filter);
gray = this.createImage(producer);
| public void | paint(java.awt.Graphics g)Display the original image and gray version side-by-side
g.drawImage(orig, 25, 25, this);
g.drawImage(gray, 200, 25, this);
|
|