Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / September 2003

Tip: Looking for answers? Try searching our database.

Making a transparent double buffer

Thread view: 
Antti S. Brax - 07 Sep 2003 15:01 GMT
    Is it possible to make a transparent double buffer? The fillRect,
    clearRect and setPaintMode methods in java.awt.Graphics don't
    seem to do what they say (filling or clearing a rectangle with
    a transparent color does not seem to have any effect).

    I am writing a board game and would like to keep the background
    image and the pieces on the board on separate layers so that I
    don't have to redraw everything when one piece on the board
    changes state.

Signature

Antti S. Brax - asb(at)iki.fi   Rullalautailu pitää lapset poissa ladulta
  http://www.iki.fi/asb/          http://www.cs.helsinki.fi/u/abrax/hlb/

Skippy - 07 Sep 2003 20:29 GMT
> Is it possible to make a transparent double buffer? The fillRect,
> clearRect and setPaintMode methods in java.awt.Graphics don't
[quoted text clipped - 5 lines]
> don't have to redraw everything when one piece on the board
> changes state.

I did this once by setting the pixels of a MemoryImageSource to 0x00FFFFFF
and created an Image from it. This problem is solved in java 1.5 where you
can have transparance when creating BufferedImages. Although the 1.4 javadoc
says it's already possible, I couldn't get it to work...

Good luck!


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.