Display .png image in a window in wxPython

How to show .png image in a window in wxPython?

+8
png wxpython
source share
2 answers
 png = wx.Image(imageFile, wx.BITMAP_TYPE_ANY).ConvertToBitmap() wx.StaticBitmap(self, -1, png, (10, 5), (png.GetWidth(), png.GetHeight())) 

Longer sample: http://web.archive.org/web/20090823114922/http://www.daniweb.com/code/snippet337.html

+11
source share
 self.png = wx.StaticBitmap(self, -1, wx.Bitmap("path/image.png", wx.BITMAP_TYPE_ANY)) 
+5
source share

All Articles