ImageTk.PhotoImage vs. Tkinter.PhotoImage
Les Schaffer
godzilla at netmeg.net
Mon Sep 27 17:42:15 EDT 1999
i need to zoom in on a user specified subset of an image.
but i am confussed about ImageTk.PhotoImage and
Tkinter.PhotoImage. the former creates an instance of the latter in
its self.__photo, used for pasting. but i need access to
Tkinter.Photoimage's copy and zoom commands. i dont understand why
ImageTk.PhotoImage doesnt just extend Tkinter.PhotoImage so the copy
and zoom methods are available, or delegate those calls to __photo
methods.
also, i notice that in Tkinter.PhotoImage the -from and -to keywords
for the image copy methods are not explicitly defined. wonder why....
this is my first real foray into using tkinter/PIL for some astro
work, so please excuse if my questions are stupid.
so, with code like this:
...
self.photo = ImageTk.PhotoImage(image)
self.canvas.create_image(0, 0, image=self.photo, anchor=NW)
...
i want to create a new PhotoImage consisting of a zoom in on a subset
of self.photo (i have the x,y coords of the desired zoom area in
self.photo).
--
____ Les Schaffer ___| --->> Engineering R&D <<---
Theoretical & Applied Mechanics | Designspring, Inc.
Center for Radiophysics & Space Research | http://www.designspring.com/
Cornell Univ. schaffer at tam.cornell.edu | les at designspring.com
More information about the Python-list
mailing list