(original) (raw)

changeset: 100486:1e7c388dc3c5 branch: 2.7 user: Terry Jan Reedy tjreedy@udel.edu date: Fri Mar 11 15:30:27 2016 -0500 files: Lib/lib-tk/Tkinter.py description: 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. diff -r 8ef74c7f3fdc -r 1e7c388dc3c5 Lib/lib-tk/Tkinter.py --- a/Lib/lib-tk/Tkinter.py Fri Mar 11 21:32:12 2016 +0200 +++ b/Lib/lib-tk/Tkinter.py Fri Mar 11 15:30:27 2016 -0500 @@ -3380,16 +3380,20 @@ 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) /tjreedy@udel.edu