How to resize tkinter label widget
fredrik at pythonware.com
Sat Sep 8 14:36:14 CEST 2001
Eric Frey wrote:
> I am trying to let users resize an image created with PIL and expand the
> label widget (and the window) that I am using to display the image. I
> am using the PIL ImageTk module to create PhotoImages and displaying it
> using a label. I can successfully resize the image using PIL and paste
> it back into the photoimage.
footnote: Pasting into a visible ImageTk.PhotoImage can
be very slow. It's usually more efficient to create a new
> When I do this, the label widget stays the same size. I
> would like to expand it so it contains the new image.
given a label widget "w" and a PIL image "im",
should do the trick.
hope this helps!
<!-- (the eff-bot guide to) the python standard library:
More information about the Python-list