bpo-33283: Mention PNG as a supported format by Tcl/Tk. (GH-6479)

(cherry picked from commit 4b685bf719)

Co-authored-by: Andrés Delfino <34587441+andresdelfino@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2018-04-18 11:16:46 -07:00 committed by GitHub
parent 3b3be1fe10
commit b88f73749d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View File

@ -783,12 +783,13 @@ Menu indexes (menu.invoke(), menu.entryconfig(), etc.)
Images Images
^^^^^^ ^^^^^^
Bitmap/Pixelmap images can be created through the subclasses of Images of different formats can be created through the corresponding subclass
:class:`tkinter.Image`: of :class:`tkinter.Image`:
* :class:`BitmapImage` can be used for X11 bitmap data. * :class:`BitmapImage` for images in XBM format.
* :class:`PhotoImage` can be used for GIF and PPM/PGM color bitmaps. * :class:`PhotoImage` for images in PGM, PPM, GIF and PNG formats. The latter
is supported starting with Tk 8.6.
Either type of image is created through either the ``file`` or the ``data`` Either type of image is created through either the ``file`` or the ``data``
option (other options are available as well). option (other options are available as well).

View File

@ -3533,7 +3533,7 @@ class Image:
self.tk.call('image', 'width', self.name)) self.tk.call('image', 'width', self.name))
class PhotoImage(Image): class PhotoImage(Image):
"""Widget which can display colored images in GIF, PPM/PGM format.""" """Widget which can display images in PGM, PPM, GIF, PNG format."""
def __init__(self, name=None, cnf={}, master=None, **kw): def __init__(self, name=None, cnf={}, master=None, **kw):
"""Create an image with NAME. """Create an image with NAME.
@ -3597,7 +3597,7 @@ class PhotoImage(Image):
self.tk.call(args) self.tk.call(args)
class BitmapImage(Image): class BitmapImage(Image):
"""Widget which can display a bitmap.""" """Widget which can display images in XBM format."""
def __init__(self, name=None, cnf={}, master=None, **kw): def __init__(self, name=None, cnf={}, master=None, **kw):
"""Create a bitmap with NAME. """Create a bitmap with NAME.