drawImage alters source image

Hi all,

I’m trying to draw a BufferedImage (image1) on another BufferedImage (image2) , using drawImage(Image i, int x, int y, ImageObserver o). Before and after calling the drawImage on the graphics of the second image, I show a JFrame containing a debug Jlabel, which has an icon with the image1. The problem is that if drawImage is called, the image1, is shown corrupted in both the frames although the one of them is constructed before calling the drawImage. drawImage always returns true, so this is not a “not ready image” problem.

What is causing the corruption of the source image? Any ideas?

TIA
N

I seriously doubt that this is possible. Could you please post your code?

Thanks,
Dmitri
Java2D Team

But are you a little worried if it is possible? ;D

I guess if you had screwy video drivers that were managing to allocate the same video memory for the image cache - it could potencially happen :o

Post some sample code demonstrating your problem mantesat

The problem was an error when using JOGL to get an image from a texture and draw it on another image. JOGL returned an (uncaught by me) glError, which resulted in a mess when trying to draw the image using java2D.

(One must check thoroughly all possibilities before posting…)