我尝试通过从另一个文件background_image.py
读取基本64字符串,将背景图像直接绘制到画布背景中。根据{{3}}这些行应该有效:
import background_image
background_image = ImageTk.PhotoImage(data=background_image.background_image)
canvas.create_image(0, 0, image=background_image, anchor=NW)
但是我收到了这个错误:
Traceback (most recent call last):
File "c:\Python34\lib\site-packages\PIL\ImageTk.py", line 118, in __del__
name = self.__photo.name
AttributeError: 'PhotoImage' object has no attribute '_PhotoImage__photo'