Search code examples
c#imagegraphicsrenderinghardware-acceleration

Drawing a single large image with the graphics card in a custom control


Simply put, I'm trying to draw an image (2560x2048) that is supposed to be zoomed / draged and such but the performance is very bad, because it flickers everytime I move it. I use a custom control to be able to drag the image to a new position and zoom in and out, which means it have to be flexible and fast.

So, what is the easiest and best way to just draw a single image with the graphics card? Without having to initialize a thousand directX objects just for one simple purpose.

Overall, the application is a tool - so not a game. But this particular large image is supposed to be drawn effectively.


Solution

  • Double buffering is your friend http://msdn.microsoft.com/en-us/library/3t7htc9c.aspx