tkinter笔记六

图像(Images)

gifdir = "D:\MYhtml"    #图片文件夹
from tkinter import *
win = Tk()
igm = PhotoImage(file=gifdir + "\my.gif")
Button(win, image=igm).pack()
win.mainloop()

gifdir = "D:\MYhtml"
from tkinter import *
win = Tk()
img = PhotoImage(file=gifdir + "\my.gif")
can = Canvas(win)
can.pack(fill=BOTH)
can.create_image(100, 100, image=img, anchor=NW) # x, y coordinates x,y坐标
win.mainloop()

未完...

posted @ 2016-03-06 13:40  zw~菜园子  阅读(255)  评论(0编辑  收藏  举报