I've written an application that loads an image and draws a repeated grid of
this image to the screen like a chessboard. When I use a jpeg or a png (with
no transparency) I can draw 1000 of these instantaneously (or at least fast
enough for my purposes). When I use a transparent image (for example I am
testing with a coloured ball on a white background and then the same ball but
with 'no' background), it takes approximately 17 seconds to draw the final
image (of 1000 balls). This is a program that I was working on some time ago
and as I remember it, it worked fine. Since I last used it I have reinstalled
my OS and put on a newer version of NetBeans (and JDK). Is this a known
problem or is there something else going on here?
I am running Windows XP. The image I was testing with is 185 x 185 pixels (so
not big).
I essentially load the file and create a copy (as it is used elsewhere),
// Create an exact copy of the buffered image
WritableRaster raster = shapeImage.copyData( null );
BufferedImage shapeImageCopy = new BufferedImage(
shapeImage.getColorModel(), raster, shapeImage.isAlphaPremultiplied(), null );
then I do an affine transform to get it the right size and then...
// Draw the image onto the canvas
g.drawRenderedImage(shapeImage, affine_scale);
The problem is purely with transparent png's but I need to use these! As I
said, for jpeg and non-transparent pngs everything is absolutely fine.
[Message sent by forum member 'olly_olly' (olly_olly)]
http://forums.java.net/jive/thread.jspa?messageID=204839
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".