我可以加载 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)
有人对如何解决这一点有很好的提示吗?谢谢!