Thread View: borland.public.jbuilder.java.api
2 messages
2 total messages
Started by loquak
Sun, 21 Mar 2004 16:51
Transparent images
Author: loquak
Date: Sun, 21 Mar 2004 16:51
Date: Sun, 21 Mar 2004 16:51
8 lines
1192 bytes
1192 bytes
How on earth is it possible to draw transparent images in Java? I have an Image object, load the image from a file and draw it on a Graphics object. The question is: I want all black pixels to be transparent when drawn on another image. This is getting frustrating because after a day's efforts the backgroup is still black... Help please!
Re: Transparent images
Author: Tor Iver Wilhelmsen (TeamB)
Date: Mon, 22 Mar 2004 07:13
Date: Mon, 22 Mar 2004 07:13
13 lines
1368 bytes
1368 bytes
"loquak" <liam_parc@hotmail.com> writes: > How on earth is it possible to draw transparent images in Java? I have an > Image object, load the image from a file and draw it on a Graphics object. > The question is: I want all black pixels to be transparent when drawn on > another image. The easiest way is if the Image is loaded from a file format that supports transparency natively - then it should "work" as long as black is the transparent color. Other than that, you can try to get the Image's ColorModel, look for black and set its alpha component.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads