title: Which Gdiplus::Graphics::DrawImage function should I use?
body: <p>I want paste a (x,y,w,h) subrectangle from src to dest, so that the (x,y) source pixel appears as the (0,0) dest pixel. I'm having a difficulty deciding which of the gazillion overloads does this. Right now my code looks like this, which obviously doesn't work:</p>
  
  <pre><code>auto_ptr&lt;Gdiplus::Graphics&gt; g(Gdiplus::Graphics::FromHDC(pDC-&gt;GetSafeHdc()));
  g-&gt;DrawImage(png, r.top, r.bottom, r.Width(), r.Height());
  g-&gt;Flush(); 
  </code></pre>
  
  <p>It doesn't work because the (x,y) source pixel appears as the (x,y) destination pixel, whereas I want it to appear as the (0,0) destination pixel. The source and destination rectangles should have the same size but different offsets, instead of the same offset.</p>
  
  <p>[Edit]
  Nevermind, I found the overloaded function I need. Turns all I had to add was the destination (x,y) offset in front, and UnitPixel at the end.</p>
  
  <pre><code>auto_ptr&lt;Gdiplus::Graphics&gt; g(Gdiplus::Graphics::FromHDC(pDC-&gt;GetSafeHdc()));
  g-&gt;DrawImage(png, 0, 0, r.left, r.top, r.Width(), r.Height(), Gdiplus::UnitPixel);
  g-&gt;Flush();
  </code></pre>