Add image to Canvas : Image : Tkinker PYTHON TUTORIALS


PYTHON TUTORIALS » Tkinker » Image »

 

Add image to Canvas


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(22, image=img, anchor=NW)
win.mainloop()



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Tkinker
» Image