title: How do I superimpose one bitmap image on another in GDI+?
body: <p>Using GDI+ I've made a heatmap bmp and I'd like to superimpose it on top of my bmp map. I've saved the two bmps to disk, and they look good, I just need a way to put them together. Is there any way to do this, perhaps using the Graphics object?  How is transparency/alpa involved?  </p>
  
  <p>I'm very new to GDI programming so please be as specific as possible.</p>
  
  <hr>
  
  <p>OK - here's an answer.  At some point I need to learn how GDI+ works...</p>
  
  <p>I couldn't get around the transarency issues, but this works.  It just copies the non-white pixels from the overlay to the map:   </p>
  
  <pre><code>        for (int x = 0; x &lt; map.Width; x++)
              for (int y = 0; y &lt; map.Height; y++) {
                  Color c = overlay.GetPixel(x, y);
                  if ((c.A != 255) || (c.B != 255) || (c.G != 255) || (c.R != 255))
                      map.SetPixel(x, y, c);     
  </code></pre>