小编Fre*_*oke的帖子

PhotoImage 实例没有属性“resize”

尽管多个在线资源表明这是使用 PIL 调整图像大小的方法,但我还是收到了错误“PhotoImage 实例没有属性 'resize'”。有任何想法吗?

相关代码:

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)
Run Code Online (Sandbox Code Playgroud)

和 PIL 被导入为:

from PIL import Image,ImageTk
Run Code Online (Sandbox Code Playgroud)

tkinter python-imaging-library python-2.7

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