Debug: ….srccommonimage.cpp(1454): assert “Ok()” failed in wxImage::GetWidth(): invalid image

在python使用pil的wx.image的时候,一定要初始化库,否则出现:

Debug: ….srccommonimage.cpp(1454): assert “Ok()” failed in wxImage::GetWidth(): invalid image

因此正确是使用顺序是:

app = wx.App()

img = wx.Image(path)

image.getWidth()

….

版权所有,禁止转载. 如需转载,请先征得博主的同意,并且表明文章出处,否则按侵权处理.

    分享到:

Leave a Reply

Your email address will not be published. Required fields are marked *