Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Seting a transparent color.
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
DIIST




PostPosted: Mon Jun 11, 2007 5:24 pm   Post subject: Seting a transparent color.

Just wondering, say i load an image in java like so:
Java:

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. Smile
Sponsor
Sponsor
Sponsor
sponsor
rizzix




PostPosted: Mon Jun 11, 2007 5:37 pm   Post subject: RE:Seting a transparent color.

You can try setXORMode(Color c); method.. possibly. (when drawing)
DIIST




PostPosted: Mon Jun 11, 2007 8:22 pm   Post subject: 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




PostPosted: Tue Jun 12, 2007 8:17 am   Post subject: RE:Seting a transparent color.

Ya, the transparent layer in a gif file will work in Java.
DIIST




PostPosted: Tue Jun 12, 2007 8:21 am   Post subject: Re: Seting a transparent color.

yeah. It works Smile.
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: