aspose file tools*
The moose likes Applets and the fly likes Repaint transparent BufferedImage Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Repaint transparent BufferedImage" Watch "Repaint transparent BufferedImage" New topic
Author

Repaint transparent BufferedImage

Jochem Gruter
Greenhorn

Joined: Aug 16, 2011
Posts: 9
In my applet I make use of different bufferedimages and use them as a screen part. Each screenpart will only be repainted when the content needs to change. This is the abstract class of a 'screenpart'



But the buffer doesn't work because the buffer is also transparent. It will work when I change the bufferedimage type of the buffer from ARGB to RGB but this displays also a black background. So my question is: how can I correctly repaint this bufferedimage with a buffer?
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4523
    
    5

Jochem Gruter wrote:Each screenpart will only be repainted when the content needs to change.

I don't see any code that attempts to change the image in any way. I also don't see the point of painting a new BufferedImage (buffer) of the same size to the BufferedImage that this class represents at the time of construction.

Perhaps a typical implementation of the abstract paint(...) method, along with a sample of how the method is called, and where the passed-in parameter is obtained, would help clarify the question. In other words, an SSCCE <- link


luck, db
There are no new questions, but there may be new answers.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Repaint transparent BufferedImage
 
Similar Threads
cannot draw graphics
getRGB() causing problem!
Double Buffering help!
Show semi-transparent image on top of other JPEG
Generating Completely Transparent Image