title: Is Graphics.DrawImage too slow for bigger images?
body: <p>I'm currently working on a game and I wish to have a main menu with background image.</p>
  
  <p>However, I find the method <code>Graphics.DrawImage()</code> really slow. I have made some measurement. Let's assume that MenuBackground is my resource image with resolution 800 x 1200 pixels. I will draw it onto another 800 x 1200 bitmap (I render everything to a buffer bitmap first, then I scale it and finally draw it onto screen - that's how I deal with the possibility of multiple players' resolutions. But it shouldn't affect it in any way, see the next paragraph).</p>
  
  <p>So I've measured the following code:</p>
  
  <pre><code>Stopwatch SW = new Stopwatch();
  SW.Start();
  
  // First let's render background image into original-sized bitmap:
  
  OriginalRenderGraphics.DrawImage(Properties.Resources.MenuBackground,
     new Rectangle(0, 0, Globals.OriginalScreenWidth, Globals.OriginalScreenHeight));
  
  SW.Stop();
  System.Windows.Forms.MessageBox.Show(SW.ElapsedMilliseconds + " milliseconds");
  </code></pre>
  
  <p>The result is quiet surprising to me - the <code>Stopwatch</code> measures something between <code>40 - 50 milliseconds</code>. And because the background image is not the only thing to be drawn, the whole menu takes about over 100 ms to display, which implicates observable lag.</p>
  
  <p>I have tried to draw it to Graphics object given by Paint event, but the result was <code>30 - 40 milliseconds</code> - not much changed.</p>
  
  <p>So, does it mean, that <code>Graphics.DrawImage()</code> is unusable for drawing bigger images? If so, what should I do to improve the performance of my game?</p>