2017-04-16 19 views
0

出现错误'PhotoImage实例没有属性'调整大小''尽管多个在线来源声明这是使用PIL调整图像大小的方法。有任何想法吗?PhotoImage实例没有属性'调整大小'

相关代码:

Deathwing = ImageTk.PhotoImage(Image.open('Deathwing.PNG')) 

Deathwing2=Deathwing.resize((100,50),Image.ANTIALIAS) 

picture1=Label(pictures_frame,image=Deathwing2) 

picture1.grid(column=1,row=1) 

和PIL是impoted为:

from PIL import Image,ImageTk 

回答

1

对于任何人谁拥有我这样做固定它同样的问题:

deathwing=Image.open('Deathwing.PNG') 
image2=deathwing.resize((100,50),Image.ANTIALIAS) 
Deathwing2=ImageTk.PhotoImage(image2)