How to show a .png
image in a window in wxPython?
Asked
Active
Viewed 2.5k times
2 Answers
18
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

Stano
- 8,749
- 6
- 30
- 44

Ned Batchelder
- 364,293
- 75
- 561
- 662
7
self.png = wx.StaticBitmap(self, -1, wx.Bitmap("path/image.png", wx.BITMAP_TYPE_ANY))

Didier Ghys
- 30,396
- 9
- 75
- 81

Xen Non
- 91
- 1
- 3