netmaestro wrote:I'm not sure I understand why this isn't clear. You use either one of: A control constant (only one exists for now, #PB_Image_Transparent); Or a three-byte color constant for the background color if you're applying a color. No RGBA values.
Sure, it is clear once you run into a problem and look back at the documentation. But at first, you might think that when you specify 32-bit depth, you can specify a 32-bit background color in the very next parameter. (I have fallen for this mistake before.)
I don't see any reason 32-bit CreateImage should ignore alpha in background colors, EXCEPT so you can pass in a 24-bit color value like #Red and have it show up opaque rather than transparent. But if the programmer knows they're dealing with 32-bit images anyway, you could just use a function like Opaque(#Red).
netmaestro wrote:As far as the black background on a PNG image from using #PB_Image_Transparent I initially thought you might be on to something there when I viewed the image using the Windows 10 Photo app, but it only shows black there.
Seen this before too. It's a feature of (some components of) the Windows OS. If it loads an image and every pixel is fully transparent, it assumes the alpha channel is invalid/unintended and makes them all opaque instead.
Well, I have to confess that I definitely missed that "RGB()"-note in the docs. However, in my opinion in terms of an 32-Bit-image the constant to result in a totally transparent image ("#PB_Image_Transparent") should be "rgba(0,0,0,0)"
I fully agree. It would be nice to allow RGBA values in CreateImage. #PB_Image_Transparent changing from $FFFFFFFF to $00000000 would be backwards compatible. (24-bit images would ignore any alpha of course.)
Maybe I will write a Feature Request and see what happens