Lost contents on a BufferedImage?

Another problem… I blit a cursor to the screen, and hide the real one. It’s a little square BufferedImage. After a few alt-tabs, I found that the little square had turned to a solid white square. That sucks! I thought only VolatileImages could lose their contents, but aparantly my BufferedImage has too! Can someone explain this?

hm… strange problem. maybe the BufferedImage didnt lose its contents, myabe the window lost the ability to draw transparent pixels? can the application draw any other transparent pixels?

yup, it draws the menu beneath it with transparent pixels. Nothing else seemed affected.

But that reminds me, on Mac’s I can’t have translucent images being translated with AffineTransforms. The translucent area beneath them turns opaque black. I’ve never found a solution for that, nor have I ever asked about it… so I will now. What can I do about that?

Edit: I tried alt-tabbing more and found that more random BufferedImages would turn to white. Very strange!

This sounds like a bug. Which java version are you using? Have you tried 1.5beta3?

If you can still reproduce it on the latest bits, please file a bug (and post a test case here).

Please include info on your hw/drivers setup (video board, drivres version, os, etc)

I can’t get the BufferedImages to mess up using Balls.jar, but as far as I can tell I create and use them in the same way. Frustrating to not find consistency, but at least I have hope that I can change something in the code to help the problem. Maybe memory is getting swapped out and never back in?

This kind of situations is supposed to be handled under the hood for managed images. If it’s not happening, it’s a bug.

A reproducible testcase would help, of course, and the configuration info.

Have you tried your app on some other systems? Do you see the same problem? It could be a driver problem…

I have tried it on another system with a really good and modern graphics card and was able to reproduce the results. I haven’t come up with a test case for it because the only test case I have right now is my 4 meg game ;D However I have a hunch that that might be part of the key to the problem. The only difference I can find between my game and Balls.jar (which doesn’t display this problem) is the fact that my game uses so much more memory, which says to me this may be tied to video memory holding this images being tossed aside for other use because it’s so full already.