0

tkinter で gif 画像が動きません。助けてください。ありがとうございました

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 に答える