title: Delphi, GR32 + PngObject: converting to Bitmap32 doesn't work as expected
body: <p>I'm using GR32 for drawing multiple semi-transparent PNG images.
  So far I've been using the following method:</p>
  
  <pre><code>  png:= TPNGObject.Create;
    png.LoadFromFile(...);
    PaintBox321.Buffer.Canvas.Draw(120, 20, png);
  </code></pre>
  
  <p>however I wanted to switch to the method proposed on GR32 website (<a href="http://graphics32.org/wiki/FAQ/ImageFormatRelated" rel="nofollow noreferrer">http://graphics32.org/wiki/FAQ/ImageFormatRelated</a>) :</p>
  
  <pre><code>  tmp:= TBitmap32.Create;
    LoadPNGintoBitmap32(tmp, ..., foo);
    tmp.DrawMode:= dmBlend;
    PaintBox321.Buffer.Draw(Rect(20, 20, 20+ tmp.Width, 20+tmp.Height),
     tmp.ClipRect, tmp);
  </code></pre>
  
  <p>While the first method works perfectly fine, the second - which should give the same result - causes very strange problem with alpha channel, see the image (which also shows comparison to the same image "arranged" in Paint.NET - both background and icon were opened on the layers of the editor). The image depicts that the Bitmap32 is loaded or drawn inproperly. Any tips?</p>
  
  <p><img src="https://i.stack.imgur.com/B29T1.png" alt="Problem with TBitmap32 alpha channel"></p>
  
  <p>-- added 22 Nov</p>
  
  <p>I've found out that it is not about drawing, it's about loading PNG to BMP32. Saving back from BMP32 to PNG generates the incorrect, "whitened" (the one on the left) PNG image.</p>