Skip to content

Commit ca76100

Browse files
committed
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.
1 parent 3d3a8f6 commit ca76100

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

Lib/lib-tk/Tkinter.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3380,16 +3380,20 @@ def copy(self):
33803380
destImage = PhotoImage(master=self.tk)
33813381
self.tk.call(destImage, 'copy', self.name)
33823382
return destImage
3383-
def zoom(self,x,y=''):
3383+
def zoom(self, x, y=''):
33843384
"""Return a new PhotoImage with the same image as this widget
3385-
but zoom it with X and Y."""
3385+
but zoom it with a factor of x in the X direction and y in the Y
3386+
direction. If y is not given, the default value is the same as x.
3387+
"""
33863388
destImage = PhotoImage(master=self.tk)
33873389
if y=='': y=x
33883390
self.tk.call(destImage, 'copy', self.name, '-zoom',x,y)
33893391
return destImage
3390-
def subsample(self,x,y=''):
3392+
def subsample(self, x, y=''):
33913393
"""Return a new PhotoImage based on the same image as this widget
3392-
but use only every Xth or Yth pixel."""
3394+
but use only every Xth or Yth pixel. If y is not given, the
3395+
default value is the same as x.
3396+
"""
33933397
destImage = PhotoImage(master=self.tk)
33943398
if y=='': y=x
33953399
self.tk.call(destImage, 'copy', self.name, '-subsample',x,y)

0 commit comments

Comments
 (0)