
-----------------------------------
DIIST
Mon Jun 11, 2007 5:24 pm

Seting a transparent color.
-----------------------------------
Just wondering, say i load an image in java like so:
BufferedImage img = null;
try{
        img = ImageIO.read(new File("monkey.gif"));
    } 
catch (IOException e) {
     //Should Probably do Something
}



How would i make a certain color transparent in image monkey. Say, the color white i want to make transparent in my image. How would i do so. Im making this for  an application, not applet.  :)

-----------------------------------
rizzix
Mon Jun 11, 2007 5:37 pm

RE:Seting a transparent color.
-----------------------------------
You can try setXORMode(Color c); method.. possibly. (when drawing)

-----------------------------------
DIIST
Mon Jun 11, 2007 8:22 pm

Re: Seting a transparent color.
-----------------------------------
Are you sure there arent other ways. The method you showed me makes my screen flicker, and become bazaar. It doesn't seem to work .

Im wondering, if you have a gif file that hasa trasparent layer in it. Would it be possible to just load it and hope that it doesn't show:?

-----------------------------------
HellblazerX
Tue Jun 12, 2007 8:17 am

RE:Seting a transparent color.
-----------------------------------
Ya, the transparent layer in a gif file will work in Java.

-----------------------------------
DIIST
Tue Jun 12, 2007 8:21 am

Re: Seting a transparent color.
-----------------------------------
yeah. It works :).
