大家早上好, 我试图导入图像徽标.gif但收到一条错误消息说映像不存在。 感谢你的帮助。 丹尼斯
from PIL import Image, ImageChops
from PIL.GifImagePlugin import getheader, getdata
img = Image.open("logo.gif")
img.show()
from tkinter import *
window = Tk()
imgLbl = Label( window, image = img )
TclError: image "<PIL.GifImagePlugin.GifImageFile image mode=P size=92x95 at 0x8C92B38>" doesn't exist
请参考这篇文章Play Animations in GIF with Tkinter
这个问题似乎是重复的。 您必须首先通过ImageTk类中的PhotoImage函数将图像转换为tK兼容的图像。在
相关问题 更多 >
编程相关推荐