This topic is now archived and is closed to further replies.


[java] Transparent images

Recommended Posts

Seigfried    122
Greetings, I''m trying to get partially-transparent images to work in Java- essentially, I''m writing a little strategy game, and I''d like to be able to highlight areas that a unit can potentially move to. However, I''m having the problem that when I load an image in Java, it seems to only be able to declare a pixel as being either solid or completley transparent... All my images are currently stored as .pngs, and the "highlights" should be at 50% transparency. I''m using standard Java Images and image functions to do this. I figure I must be missing something, but I''m not sure what it is- does anyone have any advice to offer? -- EMail: -- AIM: SeigfriedH

Share this post

Link to post
Share on other sites
Kajsngweaaweg    122
Original post by jermz
If you mean a blended transparency from the alpha channel, switch to the ARGB color mode and modify the alpha bits directly, creating the final image from a MemoryImageSource.

(Taken from his post in the Java FAQ thread)
Hope this helps.

[edited by - Kajsngweaaweg on July 8, 2003 2:20:37 PM]

Share this post

Link to post
Share on other sites