Performance acceleration for many images


Is there any way to accelerate drawing a big amount of more or less small images on the screen? When I redraw many images, it has a serious impact on performance, but I really need to draw lots of them due to specifics of the program.

Or would it be better to just use custom DirectDraw based (I’m on Windows) low level graphics context to benefit from hardware acceleration for this task or for the overall graphics rendering? If so, then do I need to write this low level context class myself or there’s already one exists somewhere?



If you’ve got many small images to draw, then hardware-acceleration probably won’t help much, because the slowness is most likely due to the fixed overheads of each drawimage call, i.e. the clipping, bounds checking, etc, rather than the actual per-pixel rendering time. In fact, I’d expect software rendering to be quicker when the images are very small. If you were using opengl and had them all prepared as textures, that could be quick, but would be quite a pain to wri.

Best plan is probably to try to be smarter in the way you render, e.g. if possible, cache larger areas of your UI into temporary images rather than redrawing them all each time.