Alec Bennett wrote:
I've searched around and gather that my PNG needs to
be a PNG-8 type, as saved from Photoshop's "save for
web". I successfully have the PNG displaying in a
shaped frame so am pretty sure it's alpha channel is
set correctly. However I can't place it as a
wx.StaticBitmap.
Platform and version?
Are there any tips on this?
Here's how I'm doing it now:
bmp = wx.Image("mypng.png",
wx.BITMAP_TYPE_PNG).ConvertToBitmap()countdownPic = wx.StaticBitmap(self.panel, -1, bmp)
What exactly are you wanting to be able to see through the image? What do you see? If you use a wx.StaticBitmap then the best you can do is to see the default background of the static bitmap widget. If you just want the default solid background color then that may be enough. If you are drawing the background in some way, then you can just draw the bitmap object too and not use the static widget, then you'll get the transparent parts of the bitmap blended with what you have already drawn.
To get my FRAME_SHAPE working I had to set a shape
like this:r = wx.RegionFromBitmap(bmp)
self.SetShape(r)Do I need to do something like that here?
No, currently wx only supports shaped windows with top-level window types. BTW, that will set the shape using the bitmap's mask, if you're expecting alpha-based transparency (where pixels are only partially transparent) then you've probably edited your image wrong.
ยทยทยท
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!