Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Calcul scientifique
avec Python
Voir le programme détaillé
Classe « PhotoImage » Python 3.13.2

Méthode tkinter.PhotoImage.data

Signature de la méthode data

def data(self, format=None, *, from_coords=None, background=None, grayscale=False) 

Description

help(PhotoImage.data)

Returns image data.

The FORMAT option specifies the name of the image file format
handler to be used.  If this option is not given, this method uses
a format that consists of a tuple (one element per row) of strings
containings space separated (one element per pixel/column) colors
in “#RRGGBB” format (where RR is a pair of hexadecimal digits for
the red channel, GG for green, and BB for blue).

The FROM_COORDS option specifies a rectangular region of the image
to be returned.  It must be a tuple or a list of 1 to 4 integers
(x1, y1, x2, y2).  If only x1 and y1 are specified, the region
extends from (x1,y1) to the bottom-right corner of the image.  If
all four coordinates are given, they specify diagonally opposite
corners of the rectangular region, including (x1, y1) and excluding
(x2, y2).  The default, if this option is not given, is the whole
image.

If BACKGROUND is specified, the data will not contain any
transparency information.  In all transparent pixels the color will
be replaced by the specified color.

If GRAYSCALE is true, the data will not contain color information.
All pixel data will be transformed into grayscale.


Vous êtes un professionnel et vous avez besoin d'une formation ? Coder avec une
Intelligence Artificielle
Voir le programme détaillé