小编Lor*_*siè的帖子

将 PIL 图像转换为 wxPython 位图图像

我可以加载 JPEG 图像,将其转换为位图并在 wx 应用程序中绘制它。然而,我很难将 PIL 图像对象转换为可以绘制到 wx 应用程序中的位图。

在网上,我能找到的最好的建议是做类似的事情

wx.Bitmap(PIL_image.tobytes())
Run Code Online (Sandbox Code Playgroud)

但是,这给了我以下错误

UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 59: invalid start byte
Run Code Online (Sandbox Code Playgroud)

或者

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc8 in position 51: invalid continuation byte
Run Code Online (Sandbox Code Playgroud)

有人对如何解决这一点有很好的提示吗?谢谢!

python wxpython bitmap python-imaging-library

2
推荐指数
1
解决办法
3418
查看次数

标签 统计

bitmap ×1

python ×1

python-imaging-library ×1

wxpython ×1