FileDocCategorySizeDatePackage
ColorSep.javaAPI DocExample1235Wed Mar 26 03:16:50 GMT 1997None

ColorSep

public class ColorSep extends Applet

Fields Summary
Image
img
Image
redImg
Image
greenImg
Image
blueImg
Constructors Summary
Methods Summary
public voidinit()

		img = getImage( getClass().getResource( getParameter("img")) );
		redImg = createImage(new FilteredImageSource(img.getSource(), 
										new ColorMaskFilter( Color.red )));
		greenImg = createImage(new FilteredImageSource(img.getSource(), 
										new ColorMaskFilter( Color.green )));
		blueImg = createImage(new FilteredImageSource(img.getSource(), 
										new ColorMaskFilter( Color.blue )));
	
public voidpaint(java.awt.Graphics g)

		int width = getSize().width, height = getSize().height;
		g.drawImage( redImg, 0, 0, width/3, height, this );
		g.drawImage( greenImg, width/3, 0, width/3, height, this );
		g.drawImage( blueImg, 2*width/3, 0, width/3, height, this );