mirror of
https://github.com/python/cpython.git
synced 2025-11-02 11:08:57 +00:00
bpo-25451: Add transparency methods to tkinter.PhotoImage. (GH-10406)
This commit is contained in:
parent
f66e336f45
commit
50866e9ed3
4 changed files with 25 additions and 0 deletions
|
|
@ -4124,6 +4124,15 @@ class PhotoImage(Image):
|
|||
args = args + ('-from',) + tuple(from_coords)
|
||||
self.tk.call(args)
|
||||
|
||||
def transparency_get(self, x, y):
|
||||
"""Return True if the pixel at x,y is transparent."""
|
||||
return self.tk.getboolean(self.tk.call(
|
||||
self.name, 'transparency', 'get', x, y))
|
||||
|
||||
def transparency_set(self, x, y, boolean):
|
||||
"""Set the transparency of the pixel at x,y."""
|
||||
self.tk.call(self.name, 'transparency', 'set', x, y, boolean)
|
||||
|
||||
|
||||
class BitmapImage(Image):
|
||||
"""Widget which can display images in XBM format."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue