[Tutor] How Do I Put an Image on a Canvas and Display it?

Alan Gauld alan.gauld at btinternet.com
Mon Jan 26 18:14:25 CET 2009


"Wayne Watson" <sierra_mtnview at sbcglobal.net> wrote 

> lIts own image class. Interesting. ImageTk, apparently. 

No just image. imageTk wouldn't hide your Image.

>>> from Tkinter import *
>>> Image
<class Tkinter.Image at 0x7fdee35c>
>>> help(Image)
Help on class Image in module Tkinter:

class Image
 |  Base class for images.
 |
 |  Methods defined here:
 |
 |  __del__(self)
 |
 |  __getitem__(self, key)
 |
 |  __init__(self, imgtype, name=None, cnf={}, master=None, **kw)
 |
 |  __setitem__(self, key, value)
 |
 |  __str__(self)
 |
 |  config = configure(self, **kw)
 |
 |  configure(self, **kw)
 |      Configure the image.
 |
 |  height(self)
 |      Return the height of the image.
 |
 |  type(self)
 |      Return the type of the imgage, e.g. "photo" or "bitmap".
 |
 |  width(self)
 |      Return the width of the image.

HTH,

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld



More information about the Tutor mailing list