Hi... I'm getting some very strange behaviour (=completely broken) for a drawImage call. I've managed to scale the thing down to this file. Could someone test the following class and tell me if it works properly?

I get garbage on Windows (and a huge amount of it) with these combinations:BufferedImage img = getGraphicsConfiguration().createCompatibleImage(32,32,Transparency.OPAQUE);BufferedImage img = getGraphicsConfiguration().createCompatibleImage(32,32,Transparency.BITMASK);BufferedImage img = new BufferedImage(32,32,BufferedImage.TYPE_INT_RGB);

I get a proper result with :BufferedImage img = getGraphicsConfiguration().createCompatibleImage(32,32,Transparency.TRANSLUCENT);BufferedImage img = new BufferedImage(32,32,BufferedImage.TYPE_INT_ARGB);

The "null" could pose problems!? Try to use "this" instead - see if the problem is still there...

The null is who gets notified of image progress, it should be (and in this case is) irrelevant.Seems a problem with the BitBlt software routines. I'll test if this happens with Java 6 and file a bug if it does.

the black square is garbage... you didn't try workaround. Instead of OPAQUE put TRANSLUCENT and you'll see that image changes, the black square disappears and only red circle is visible.

I don't consider the black square garbage. If you make a BufferedImage opaque, then some colour has to be drawn for every pixel that it covers. Since BufferedImages store their information in an array of primitives(byte, int, etc) then they are defaulted to 0 unless you overwrite them. Since 0 red, 0 green and 0 blue is black, that is what is drawn. Every type that ahristov presented gave me results that I would expect.

java-gaming.org is not responsible for the content posted by its members, including references to external websites,
and other references that may or may not have a relation with our primarily
gaming and game production oriented community.
inquiries and complaints can be sent via email to the info‑account of the
company managing the website of java‑gaming.org