• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Making an image transparent

 
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:

 
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.
 
What could go wrong in a swell place like "The Evil Eye"? Or with this tiny ad?
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!