My view on TWin32WidgetSet.StretchMaskBlt(), is it should never have alpha blended 32bit bitmaps by default.
That one discussion meant it was required to check every alpha value so that freshly made 32bit TBitmaps that are drawn to using TCanvas would be visible (ie: opaque).
But, if you save out those TBitmap's to PNG's, they don't contain matching alpha channels, so, the PNG's are invisible in photo editing app's.
So, it was an incomplete hack IMHO, which fails if you first load a JPEG/PNG, since the alpha channel will not be completely clear. So, you end up with transparent TCanvas drawings on JPEG/PNG's.
Ideally! The Windows GDI (and other platforms) should set the alpha to 255. That would solve everything, but, Windows doesn't (by default) and Im unsure if that can be changed.
I guess, the situation is compounded by JPEG's/PNG's being loaded as 32bit, even if they only require 24bits, and the fact that changing PixelFormat to 24bit clears the image to black.
Fine, if you know what is happening. Really irritating if you dont. I remember first moving to Lazarus, and being totally irritated by this situation. It all felt buggy to me. But, once I understood what was happening, I learned the ways to resolve the issue.
But, to a Lazarus new comer, this, all looks confusing and buggy.