Mailing List Archive

Tkinter canvas scaling does not work for Images??
Hi There,

I'm playing around with Pmw and (thus Tkinter). After some
experiments, I found out that I can scale lines and such, but Images
do not seem to respond to similar requests. The docs don't seem to
mention this interesting limitation.

Any clues?

Regards,
--
John van der Koijk.
--
TNO Institute of Industrial Technology

PO Box 5073, 2600 GB, Delft, The Netherlands
Phone +31 15 2608833, Fax +31 15 2608846
Tkinter canvas scaling does not work for Images?? [ In reply to ]
John van der Koijk wrote:
> I'm playing around with Pmw and (thus Tkinter). After some
> experiments, I found out that I can scale lines and such, but Images
> do not seem to respond to similar requests. The docs don't seem to
> mention this interesting limitation.

answer 1: the "scale" method modifies the item coordinates
only. since bitmaps, images, windows, and text strings have
a single coordinate pair, they can only move around, not
change size...

answer 2: resizing images and fonts on the fly is a non-trivial
problem, especially if you want both performance and port-
ability. so Tk simply passes on this one...

in other words, you're on your own. it can be done,
but it takes some work...

</F>