无法使用PhotoImage读取base 64字符串

时间:2014-11-24 17:00:12

标签: python tkinter

我尝试通过从另一个文件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'

0 个答案:

没有答案