diff options
author | Terry Jan Reedy <tjreedy@udel.edu> | 2016-03-11 20:30:27 (GMT) |
---|---|---|
committer | Terry Jan Reedy <tjreedy@udel.edu> | 2016-03-11 20:30:27 (GMT) |
commit | ca7610020560bc1b1fbf3a062eeea075af2596ca (patch) | |
tree | a5d5d037cd21e4c636cbb907e056297931e603ed /Lib/lib-tk | |
parent | 3d3a8f6c7bac164becb6c3b3ff56ba6bd9171a6b (diff) | |
download | cpython-ca7610020560bc1b1fbf3a062eeea075af2596ca.zip cpython-ca7610020560bc1b1fbf3a062eeea075af2596ca.tar.gz cpython-ca7610020560bc1b1fbf3a062eeea075af2596ca.tar.bz2 |
Issue 25959: Explain in docstring that PhotoImage.zoom arguments are
multipliers, not final sizes. Explain y default for .zoom and .subsample.
Initial patch by Serhiy Storchaka.
Diffstat (limited to 'Lib/lib-tk')
-rw-r--r-- | Lib/lib-tk/Tkinter.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py index f51013e..d8d5b80 100644 --- a/Lib/lib-tk/Tkinter.py +++ b/Lib/lib-tk/Tkinter.py @@ -3380,16 +3380,20 @@ class PhotoImage(Image): destImage = PhotoImage(master=self.tk) self.tk.call(destImage, 'copy', self.name) return destImage - def zoom(self,x,y=''): + def zoom(self, x, y=''): """Return a new PhotoImage with the same image as this widget - but zoom it with X and Y.""" + but zoom it with a factor of x in the X direction and y in the Y + direction. If y is not given, the default value is the same as x. + """ destImage = PhotoImage(master=self.tk) if y=='': y=x self.tk.call(destImage, 'copy', self.name, '-zoom',x,y) return destImage - def subsample(self,x,y=''): + def subsample(self, x, y=''): """Return a new PhotoImage based on the same image as this widget - but use only every Xth or Yth pixel.""" + but use only every Xth or Yth pixel. If y is not given, the + default value is the same as x. + """ destImage = PhotoImage(master=self.tk) if y=='': y=x self.tk.call(destImage, 'copy', self.name, '-subsample',x,y) |