[IMAGE-SIG] Changing a displayed image

Fredrik Lundh Fredrik Lundh" <fredrik_lundh@ivab.se
Thu, 10 Jul 1997 18:58:05 +0200


>When this code gets run, the window resizes as appropriate (since the
>image isn't square) but the image isn't displayed; the area remains
>blank.  What am I missing?  (Presumably this is due to my poor
>understanding of Tkinter.)

You must make sure to keep a reference to the PhotoImage
object. See the following page for more info:

http://starship.skyport.net/crew/fredrik/tkintro/PhotoImage.htm

And yes, to change the image, just reconfigure the label:

self.viewer.config(image=image)
self.viewer.image = image # keep a reference!

Cheers /F




_______________
IMAGE-SIG - SIG on Image Processing with Python

send messages to: image-sig@python.org
administrivia to: image-sig-request@python.org
_______________