private static final long serialVersionUID = 1L;
Image PWNAGE;
Image one;
Image two;
Graphics bg;
Image screen;
Dimension dim;
Font goodFont = new Font("Helvetica", Font.PLAIN, 22);
public void init() {
setBackground(new Color(0).white);
setSize(1280, 1024);
dim = getSize();
screen = createImage(dim.width, dim.height);
bg = screen.getGraphics();
addMouseListener(this);
one = getImage(getDocumentBase(),JOptionPane.showInputDialog(null, "Type in first image file name."));
two = getImage(getDocumentBase(),JOptionPane.showInputDialog(null, "Type in second image file name."));
try {
PWNAGE = makeColorTransparent(two, new Color(0).blue);
}
catch(Exception e) {}
}
public static Image makeColorTransparent(Image im, final Color color) {
ImageFilter filter = new RGBImageFilter() {
public final int filterRGB(int x, int y, int rgb) {
return 0xBDFFFFFF & rgb;
}
};
ImageProducer ip = new FilteredImageSource(im.getSource(), filter);
return Toolkit.getDefaultToolkit().createImage(ip);
}
}