• Post Reply Bookmark Topic Watch Topic
  • New Topic

Making an image transparent  RSS feed

 
Edward Nelson
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm creating a drawing in an applet using double buffering.

I want to make the background color of the applet visible through the image when it is drawn.

Is it possible to do such a thing?

Here's the pseudo code of what I'm doing:

 
Paul Michael
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the desktop world they make a snapshot of the desktop then make it the background for drawing your application's images. The problem with this approach is when you try to move the application window (in which case the background will most probably turn out wrong).

But this sort of problem can be fixed by adding some window drag/move listeners.

You should be able to apply this concept to applets I suppose.

Anyway, it looks like I found an example of what you actually need.

Hope this helps.
 
Paul Michael
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops I just thought you might be interested also in this other example: Transparent Image Graphics for Java.
 
Edward Nelson
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the replies, Paul. I'll look up the links you've given.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!