wx.Clipboard Bitmap Alpha Layer

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

wx.Clipboard Bitmap Alpha Layer

magurp244
I'm currently using wxPython v3.0.2.0, I've been experiementing with the wx.Clipboard lately with copy/pasting image data. So far I can export bitmap data with an alpha layer to external programs by using ImageFromBuffer, converting to Bitmap/BitmapDataObject, but doing the reverse is proving to be problematic. Using a fresh wx.BitmapDataObject I can import the data from the clipboard, but can't seem to directly access that data it without getting errors, converting to a Bitmap at times throws an error when trying to convert to an Image, but in all cases the alpha layer is stripped. There wouldn't happen to be some way to preserve the alpha layer, or to access clipboard data so I could reconstruct images myself would there?

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: wx.Clipboard Bitmap Alpha Layer

magurp244
Whup! Nevermind, it seems the data's actually preserved in the wx.BitmapDataObject when porting to Bitmap dispite indications to the contrary with HasAlpha returning False and it not saving to file, but to get at the data I had to use GetBitmap to convert it and redraw it to a wx.EmptyBitmap with wx.MemoryDC to sanitize it, then dumped the data to a numpy array with CopyToBuffer using wx.BitmapBufferFormat_RGBA, in case anyone else finds this useful.

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.