mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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().
This commit is contained in:
parent
09871c9223
commit
1b639a04ca
5 changed files with 271 additions and 20 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue