When copying an image with transparencies, the image copies to the clipboard successfully. But when pasting the image into a Xojo canvas, all transparencies are lost. I’ve even tried
Dim xClip as new Clipboard
If xClip.PictureAvailable then
Dim npic as new Picture(xClip.Picture.Width, xClip.Picture.Height,32)
npic = xClip.Picture
Window1.Canvas.Backdrop = npic
end if
ensuring that the new Picture class object was created with the ability to handle transparencies, before dumping the clipboard into it.
The issue does not appear in Windows systems, transparencies are preserved. Is this a Mac OS bug? or the Mac clipboard has always flattened images? I thought about using a mask to ‘re-create’ the original images, although using color based masks (i.e. at pixel 1x1) is very inefficient since sometimes solid white will want to be preserved in the image itself (not made transparent).
Looking for some input to implement an efficient workaround for this issue. The problem doesn’t lie in Xojo, nor the framework. This is definitely a Mac OSX clipboard issue.