When I use wx.RegionFromBitmap to create a region from a transparent bitmap, and then call wx.Frame.SetShape to set the region as the frame’s shape, even the transparent part of the bitmap is not transparent in the frame. What’s the matter? Is anything wrong?
PS: I know we could use wx.RegionFromBitmapColour could meet my need. However, I want to know why we can’t use wx.RegionFromBitmap and a transparent picture to produce the same effect.
Does the image have an alpha channel instead of a mask? For PNG type image files, for example, if any pixel's transparency value is something other than 0 or 255 then it will be loaded in to wx with an alpha channel. If all are either 0 or 255 then it will be loaded as a mask instead. wx.RegionFromBitmap can only use a mask. You can use wx.Image.ConvertAlphaToMask to force it to be a mask if needed
···
On 10/14/12 4:21 AM, Dae James wrote:
When I use wx.RegionFromBitmap to create a region from a transparent
bitmap, and then call wx.Frame.SetShape to set the region as the frame's
shape, even the transparent part of the bitmap is not transparent in the
frame. What's the matter? Is anything wrong?
PS: I know we could use wx.RegionFromBitmapColour could meet my need.
However, I want to know why we can't use wx.RegionFromBitmap and a
transparent picture to produce the same effect.