Add image to Canvas : Image « Tkinker « Python Tutorial






from sys import argv
from Tkinter import *

filename = '1.gif'   
win = Tk()
img = PhotoImage(file=filename)
can = Canvas(win)
can.pack(fill=BOTH)
can.config(width=img.width(), height=img.height())  
can.create_image(2, 2, image=img, anchor=NW)
win.mainloop()








18.15.Image
18.15.1.Add image to button
18.15.2.Add image to Canvas