javax.swing

Class GrayFilter

public class GrayFilter extends RGBImageFilter

Produces grayscale images out of colored images. This is used to provide default disabled icons for buttons.
Constructor Summary
GrayFilter(boolean b, int p)
Create a GrayFilter.
Method Summary
static ImagecreateDisabledImage(Image src)
Create grayed image
intfilterRGB(int x, int y, int rgb)
Filter RGB to gray

Constructor Detail

GrayFilter

public GrayFilter(boolean b, int p)
Create a GrayFilter. If b is true then brighten. Also, indicate how much gray.

Parameters: b if brighten p percent of gray, 0 - 100

Method Detail

createDisabledImage

public static Image createDisabledImage(Image src)
Create grayed image

Parameters: src image to gray

Returns: a grayed image

filterRGB

public int filterRGB(int x, int y, int rgb)
Filter RGB to gray