Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Showing a .png image in a window in wxPython

Tags:

png

wxpython

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

like image 415
Alex Avatar asked Aug 22 '09 12:08

Alex


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

like image 169
Ned Batchelder Avatar answered Sep 30 '22 07:09

Ned Batchelder


self.png = wx.StaticBitmap(self, -1, wx.Bitmap("path/image.png", wx.BITMAP_TYPE_ANY))
like image 20
Xen Non Avatar answered Sep 30 '22 09:09

Xen Non