0

I'm trying to load up an image and render it to screen as fast as I can.

Using a 3mb image, I can paint it to a pictureBox but it takes a second to render.

If I throw it over to an embedded xaml image control, I can get the time down to about half a second.

I read that rendering the image to a panel, or form is faster than a picturebox, but I've been unable to verify this.

Does anyone know the FASTEST way to take an image and render it to screen in c# WinForms?

Drew Salesse
  • 127
  • 1
  • 3
  • 18
Simon Hopwood
  • 83
  • 2
  • 9
  • 2
    DirectX? (good luck with c# though) – gunr2171 May 22 '13 at 13:51
  • This is vague, it just takes a while to move 3 megabytes. The pixel format of the bitmap matters a great deal, 32bppPArgb renders ten times faster than all the other ones since it is directly compatible with the way pixels are stored in the video adapter. And it is very important that you prescale the image so it doesn't need to get resized when it is drawn. These kind of bitmap conversions however take time as well. – Hans Passant May 22 '13 at 13:54
  • WPF would do better than DirectX if you are looking for hardware acceleration. – vcsjones May 22 '13 at 13:56

0 Answers0