Showing a .png image in a window in wxPython

前端 未结 2 1153
余生分开走
余生分开走 2020-12-30 09:17

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

相关标签:
2条回答
  • 2020-12-30 09:53
    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

    0 讨论(0)
  • 2020-12-30 09:54
    self.png = wx.StaticBitmap(self, -1, wx.Bitmap("path/image.png", wx.BITMAP_TYPE_ANY))
    
    0 讨论(0)
提交回复
热议问题