root 窗口可以随意拖拉调整其大小,如何让其内的图片也随之改变?
代码示例:
import tkinter as tk
root = tk.Tk()
can = tk.Canvas(root,width=950,height=450,bg='white')
im = tk.PhotoImage(file='test.gif')
can .create_image(475,225,image=im)
can.pack(fill='both',expand=1)
root.mainloop()
1
explist OP 消灭零回复
|