wxPython 似乎缺少“一些”示例。
我有以下在 Windows 上无法运行的代码:
import wx
wx.InitAllImageHandlers() # calling it doesn't make any difference
print wx.Image("sample.bmp") # also tried with type=wx.BITMAP_TYPE_ANY
返回的值为None
,我还可以看到一条警告:Warning: No handler found for image type.
我尝试添加第二行,但似乎没有任何改变。
最佳答案
您可能需要先创建wx.App
。
import wx
app = wx.App(False)
print wx.Image("wallpaper.bmp")
关于windows - 如何在 Windows 上使用 wxPython 加载 BMP 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8083544/