import j ava.awt.*;
import java.awt.event.*;
import java.awt.image.*;
class RGBTest extends Frame{
private Image img, newimg;
RGBTest(String s){
super(s);
img = getToolkit().getlmage("javalogo52x88.gif");
RGBImageFilter rgb = new CoiorFilter();
newimg = createlmage(new FilteredlmageSource(img.getSource(), rgb));
setSize(400, 350);
setVisible(true);
} public void paint(Graphics g){
g.drawlmage(img, 10, 40, this);
g.drawlmage(newimg, 150, 40, this);
}
public static void main(String[] args){
Frame f= new RGBTest(" Изменение цвета");
f.addWindowListener(new WindowAdapter(){
public void wlndowClosing(WindowEvent ev){
System.exit(0);
}
});
)
}
class CoiorFilter extends RGBImageFilter{ CoiorFilter(){
canFilterlndexColorModel = true; }
public int fiiterRGB(int x, int y, int rgb){
return rgb » 1;
}
}