How to place a transparent PNG on a panel?

Alec Bennett whatyoulookin at yahoo.com
Mon Jan 21 22:55:59 PST 2008


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.

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)

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?

Thanks for any help.












      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page. 
http://www.yahoo.com/r/hs




More information about the wxpython-users mailing list