summaryrefslogtreecommitdiffstats
path: root/Doc/library/tkinter.rst
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2024-05-06 14:33:15 (GMT)
committerGitHub <noreply@github.com>2024-05-06 14:33:15 (GMT)
commit1b639a04cab0e858d90e2ac459fb34b73700701f (patch)
treea76e34ec01d564451def7ddbe8dc7da2940848c0 /Doc/library/tkinter.rst
parent09871c922393cba4c85bc29d210d76425e076c1d (diff)
downloadcpython-1b639a04cab0e858d90e2ac459fb34b73700701f.zip
cpython-1b639a04cab0e858d90e2ac459fb34b73700701f.tar.gz
cpython-1b639a04cab0e858d90e2ac459fb34b73700701f.tar.bz2
gh-118225: Support more options for copying images in Tkinter (GH-118228)
* Add the PhotoImage method copy_replace() to copy a region from one image to other image, possibly with pixel zooming and/or subsampling. * Add from_coords parameter to PhotoImage methods copy(), zoom() and subsample(). * Add zoom and subsample parameters to PhotoImage method copy().
Diffstat (limited to 'Doc/library/tkinter.rst')
-rw-r--r--Doc/library/tkinter.rst9
1 files changed, 9 insertions, 0 deletions
diff --git a/Doc/library/tkinter.rst b/Doc/library/tkinter.rst
index e084d85..7e5dee1 100644
--- a/Doc/library/tkinter.rst
+++ b/Doc/library/tkinter.rst
@@ -979,6 +979,15 @@ of :class:`tkinter.Image`:
Either type of image is created through either the ``file`` or the ``data``
option (other options are available as well).
+.. versionchanged:: 3.13
+ Added the :class:`!PhotoImage` method :meth:`!copy_replace` to copy a region
+ from one image to other image, possibly with pixel zooming and/or
+ subsampling.
+ Add *from_coords* parameter to :class:`!PhotoImage` methods :meth:`!copy()`,
+ :meth:`!zoom()` and :meth:`!subsample()`.
+ Add *zoom* and *subsample* parameters to :class:`!PhotoImage` method
+ :meth:`!copy()`.
+
The image object can then be used wherever an ``image`` option is supported by
some widget (e.g. labels, buttons, menus). In these cases, Tk will not keep a
reference to the image. When the last Python reference to the image object is