How to show a .png
image in a window in wxPython?
Asked
Active
Viewed 2.2k times
2 Answers
16
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
![](../../users/profiles/1422309.webp)
Stano
- 7,265
- 6
- 26
- 41
![](../../users/profiles/14343.webp)
Ned Batchelder
- 323,515
- 67
- 518
- 625
6
self.png = wx.StaticBitmap(self, -1, wx.Bitmap("path/image.png", wx.BITMAP_TYPE_ANY))
![](../../users/profiles/123127.webp)
Didier Ghys
- 29,364
- 9
- 67
- 76
![](../../users/profiles/1150084.webp)
Xen Non
- 81
- 1
- 3