【问题标题】:Showing a .png image in a window in wxPython在 wxPython 的窗口中显示 .png 图像
【发布时间】:2010-11-21 21:36:56
【问题描述】:

如何在 wxPython 的窗口中显示.png 图像?

【问题讨论】:

    标签: wxpython png


    【解决方案1】:
    png = wx.Image(imageFile, wx.BITMAP_TYPE_ANY).ConvertToBitmap()
    wx.StaticBitmap(self, -1, png, (10, 5), (png.GetWidth(), png.GetHeight()))
    

    更长的样本:http://web.archive.org/web/20090823114922/http://www.daniweb.com/code/snippet337.html

    【讨论】:

      【解决方案2】:
      self.png = wx.StaticBitmap(self, -1, wx.Bitmap("path/image.png", wx.BITMAP_TYPE_ANY))
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2020-03-20
        • 2012-01-06
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多