Image canvas : Canvas « GUI Tk « Python






Image canvas

Image canvas
gifdir = "./"
from sys import argv
from Tkinter import *
filename = 'logo.gif'    
win = Tk()
img = PhotoImage(file=gifdir+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()



           
       








Related examples in the same category

1.Canvas: Simple plotCanvas: Simple plot
2.Bound Scale action with a canvasBound Scale action with a canvas
3.Canvas inside a frameCanvas inside a frame
4.Use canvas to draw line, oval, rectangle, bitmap and arc
5.Bind mouse click action to the object on a canvasBind mouse click action to the object on a canvas
6.Bind action to canvasBind action to canvas
7.Use mouse to draw a shape on canvasUse mouse to draw a shape on canvas