applet slowdown with transparent images

Hello,

I’ve made an applet, where i draw a GIF image. If i run it with 16 color bits, i get 170 fps (with or without image transparency). But with 32 color bits, i get 90 fps without transparency and only 8 fps with transparency!!

All images are created with Toolkit.getImage(), and drawn with g.drawImage(image,0,0,this);

I’m working on a AMD Athlon 1600 XP, W2000, IE 5.5, jvm 1.1.7 and a NVIDIA geforce 2 mx400 with the lastest drivers.

It’s normal? What could be the problem?

Thanks!

try copying (drawing) them into images created with createCompatibleVolatileImage this is probably an issue with the system having to convert the image into a 32 bit compatible image for every blit because they weren’t done as above.

im using 1.1.7, so i cant use that method :-/

Ah, I think in that case you are going to be at the mercy of however the client is configured (meaning their display settings vs. the compatability of the image you are creating). One very very very ugly ugly hack that I can think of (I don’t even know why i’m suggesting this) is you could set up a timer on startup and time how long it takes to blit 100 times to the screen with different image formats and use the format that blits fastest. It’s a horrible solution, I know, but that’s why they introduced the whole line of createCompatable methods.

-Chris

Well, if you’re with 1.1.7, we can’t really help you much.

The thing is that we actually used to have sort of hardware acceleration back in 1.1.x days: we used device dependant bitmaps for storing images, which means that they can be stored in vram if the driver chooses to. May be in 32-bit you’re running out of vram, so the os choses to keep them in system memory, copies from which to the screen are way slower.