Skip to main content
gamedev.net
🔒 Locked

[java] Problems with VolatileImage

Started by Dial-Up 3 replies 1.2k views
Original Post
Dial-Up
Dial-Up
I'm having some problems with my VolatileImages: First, I load PNG files with transparent regions into BufferedImages using ImageIO and then draw them into VolatileImages. When these VolatileImages are drawn to the screen, they have white where they're supposed to be transparent. I've tried specifying both BITMASK and TRANSLUCENT transparencies when creating the VolatileImage and neither way worked. I also tried with the translaccel option set to true. The other problem I have is that when I try to validate my images, they go completely white. The validation returns IMAGE_OK and contentsLost() returns false, so I'm rather confused about this. Using VolatileImages is very important. Could anyone please help me? Thanks.
blow
blow
Hi, use compatibleImage instead VolatileImage, so u have an autoaccelerated image in vram.
Dial-Up
Dial-Up
I'm creating my VolatileImage with the createCompatibleVolatileImage() function, and VolatileImages are accelerated images in VRAM.
Dial-Up
Dial-Up
Well, I managed to find my answer on another forum. For those having similiar issues, you can find the thread at: http://forums.java.net/jive/thread.jspa?threadID=17867&tstart=0

Basically, the solution was that I was not clearing my VolatileImage to a transparent colour before drawing to it.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.