What's the fastest way to draw an image in Windows.Forms?
I have used several methods in the past to draw images in Windows.Forms and now I am revisiting some of the core libraries that handle image images for our product. I'm interested in drawing the same image (tiled) multiple times to represent the background control field. Assuming the image is exactly sized (no scaling required) and only contains the portion to be laid out, what is the fastest way to draw this image to the screen?
One of the optimizations I've used is converting the image to PixelFormat.Format32bpp P Argb, which pre-calculates some of the alpha channels.
Is there a performance difference between DrawImage and DrawImageUnscaled?
Look for real world experiences, not documented expectations.
Update: . After digging around the framework classes, I see that the Control class is using a TextureBrush using the image to be laid out. This looks promising.
a source to share