mirror of
https://github.com/python/cpython.git
synced 2025-11-03 11:23:31 +00:00
Merge with 3.5
This commit is contained in:
commit
a55553d7e3
1 changed files with 8 additions and 4 deletions
|
|
@ -3406,16 +3406,20 @@ class PhotoImage(Image):
|
||||||
destImage = PhotoImage(master=self.tk)
|
destImage = PhotoImage(master=self.tk)
|
||||||
self.tk.call(destImage, 'copy', self.name)
|
self.tk.call(destImage, 'copy', self.name)
|
||||||
return destImage
|
return destImage
|
||||||
def zoom(self,x,y=''):
|
def zoom(self, x, y=''):
|
||||||
"""Return a new PhotoImage with the same image as this widget
|
"""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)
|
destImage = PhotoImage(master=self.tk)
|
||||||
if y=='': y=x
|
if y=='': y=x
|
||||||
self.tk.call(destImage, 'copy', self.name, '-zoom',x,y)
|
self.tk.call(destImage, 'copy', self.name, '-zoom',x,y)
|
||||||
return destImage
|
return destImage
|
||||||
def subsample(self,x,y=''):
|
def subsample(self, x, y=''):
|
||||||
"""Return a new PhotoImage based on the same image as this widget
|
"""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)
|
destImage = PhotoImage(master=self.tk)
|
||||||
if y=='': y=x
|
if y=='': y=x
|
||||||
self.tk.call(destImage, 'copy', self.name, '-subsample',x,y)
|
self.tk.call(destImage, 'copy', self.name, '-subsample',x,y)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue