Showing a .png image in a window in wxPython

Alex picture Alex · Aug 22, 2009 · Viewed 21k times · Source

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

Answer

Ned Batchelder picture Ned Batchelder · Aug 22, 2009
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