0

我的 gif 图片在 tkinter 中没有移动。请帮忙。谢谢

canvas = Canvas(width = 450, height = 450, bg = 'white')
canvas.grid(row=2, column=0,sticky = 'W')
gif = PhotoImage(file = "picture.gif")
canvas.create_image(0, 0, image = gif, anchor = NW)
mainloop()
4

1 回答 1

1

Tkinter 不支持动画 gif。

tk photo 图像类支持从动画 gif 的每个子图像创建图像,并且您可以使用它创建自己的动画。我不知道 python 中的任何示例,但可以在这里看到 tcl/tk 版本:http ://wiki.tcl.tk/4882

于 2012-11-04T17:08:31.367 回答