Files
intellecton/venv/lib/python3.12/site-packages/PIL/__pycache__/ImageWin.cpython-312.pyc
T

131 lines
12 KiB
Plaintext
Raw Normal View History

Ë
ß¼j•ãó‚—ddlmZddlmZGd„d«ZGd„d«ZGd„d «ZGd
„d «ZGd „d
e«Zy)é)Ú annotationsé)ÚImagecó —eZdZdZdd„Zdd„Zy)ÚHDCz¤
Wraps an HDC integer. The resulting object can be passed to the
:py:meth:`~PIL.ImageWin.Dib.draw` and :py:meth:`~PIL.ImageWin.Dib.expose`
methods.
có—||_y©N©Údc)Úselfr s úO/home/antigravity/intellecton/venv/lib/python3.12/site-packages/PIL/ImageWin.pyÚ__init__z HDC.__init__s €Øˆ�ócó—|jSr r
©r s r
Ú__int__z HDC.__int__"s €Ø�w‰wˆrN)r ÚintÚreturnÚNone©rr©Ú__name__Ú
__module__Ú __qualname__Ú__doc__rr©rr
rrs„ñó ôrrcó —eZdZdZdd„Zdd„Zy)ÚHWNDz¶
Wraps an HWND integer. The resulting object can be passed to the
:py:meth:`~PIL.ImageWin.Dib.draw` and :py:meth:`~PIL.ImageWin.Dib.expose`
methods, instead of a DC.
có—||_yr ©Úwnd)r r!s r
rz
HWND.__init__-s €Øˆ�rcó—|jSr r rs r
rz HWND.__int__0s €Ø�x‰xˆrN)r!rrrrrrrr
rr&s„ñó ôrrcóv—eZdZdZ d
d d„Zd d„Z d
d
d„Zdd„Z d
dd„Zdd„Z dd „Z
y)ÚDiba&
A Windows bitmap with the given mode and size. The mode can be one of "1",
"L", "P", or "RGB".
If the display requires a palette, this constructor creates a suitable
palette and associates it with the image. For an "L" image, 128 graylevels
are allocated. For an "RGB" image, a 6x6x6 colour cube is used, together
with 20 graylevels.
To make sure that palettes work properly under Windows, you must call the
``palette`` method upon certain events from Windows.
:param image: Either a PIL image, or a mode string. If a mode string is
used, a size must also be given. The mode can be one of "1",
"L", "P", or "RGB".
:param size: If the first argument is a mode string, this
defines the size of the image.
Ncó^—t|t«r|}d}|€%d}t|«‚|j}|j}|dvrt j |«}t
jj||«|_ ||_||_|r$t|t«rJ‚|j|«yy)NÚz+If first argument is mode, size is required)Ú1ÚLÚPÚRGB) Ú
isinstanceÚstrÚ
ValueErrorÚmodeÚsizerÚ getmodebaseÚcoreÚdisplayÚimageÚpaste)r r3r/r.Úmsgs r
rz Dib.__init__Hs¡€ô �eœSÔ !؈D؈E؈|ØC�Ü  “oÐ%à—:‘:ˆDØ—:‘:ˆDØ Ð-Ñ -Ü×$Ñ$ TÓ*ˆDÜ—Z‘Z×'Ñ'¨¨dÓ3ˆŒ
؈Œ ؈Œ Ù Ü! %¬Ô-Ð -Ð-Ø �J‰J�uÕ ð rcóZ—t|«}t|t«rT|jj |«} |jj |«|jj
||«y|jj |«y#|jj
||«wxYw)a 
Copy the bitmap contents to a device context.
:param handle: Device context (HDC), cast to a Python integer, or an
HDC or HWND instance. In PythonWin, you can use
``CDC.GetHandleAttrib()`` to get a suitable handle.
N)rr+rr3ÚgetdcÚexposeÚ releasedc)r ÚhandleÚ
handle_intr s r
r8z
Dib.expose]s€€ô˜“[ˆ
Ü �fœdÔ #Ø—‘×!Ñ! *Ó-ˆBð
5Ø—
‘
×!Ñ! "Ô%à—
‘
×$Ñ$ Z°Õ4à �J‰J× Ñ ˜jÕ )øð—
‘
×$Ñ$ Z°Õ4ús ¸B Â B*có„—|€d|jz}t|«}t|t«rV|jj |«} |jj
|||«|jj||«y|jj
|||«y#|jj||«wxYw)am
Same as expose, but allows you to specify where to draw the image, and
what part of it to draw.
The destination and source areas are given as 4-tuple rectangles. If
the source is omitted, the entire image is copied. If the source and
the destination have different sizes, the image is resized as
necessary.
N)rr)r/rr+rr3r7Údrawr9)r r:ÚdstÚsrcr;r s r
r=zDib.drawos—€ð ˆ;ؘ4Ÿ9™9Ñ$ˆCܘ“[ˆ
Ü �fœdÔ #Ø—‘×!Ñ! *Ó-ˆBð
5Ø—
‘
—‘  C¨Ô-à—
‘
×$Ñ$ Z°Õ4à �J‰J�O‰O˜J¨¨SÕ 1øð—
‘
×$Ñ$ Z°Õ4ús Á B!Â!B?có^—t|«}t|t«rU|jj |«} |jj |«}|jj
||«|S|jj |«}|S#|jj
||«wxYw)at
Installs the palette associated with the image in the given device
context.
This method should be called upon **QUERYNEWPALETTE** and
**PALETTECHANGED** events from Windows. If this method returns a
non-zero value, one or more display palette entries were changed, and
the image should be redrawn.
:param handle: Device context (HDC), cast to a Python integer, or an
HDC or HWND instance.
:return: The number of entries that were changed (if one or more entries,
this indicates that the image should be redrawn).
)rr+rr3r7Ú
query_paletter9)r r:r;Úresults r
rAzDib.query_paletteŠs’€ô˜“[ˆ
Ü �fœdÔ #Ø—Z‘Z×%Ñ% jÓ1ˆFð
5ØŸ™×1Ñ1°&Ó9�à—
‘
×$Ñ$ V¨VÔ4ðˆ
ð—Z‘Z×-Ñ-¨jÓ9ˆF؈
øð—
‘
×$Ñ$ V¨VÕ4ús ¸BÂB,có(—|j«|j|jk7r|j|j«}|r'|jj |j
|«y|jj |j
«y)aõ
Paste a PIL image into the bitmap image.
:param im: A PIL image. The size must match the target region.
If the mode does not match, the image is converted to the
mode of the bitmap image.
:param box: A 4-tuple defining the left, upper, right, and
lower pixel coordinate. See :ref:`coordinate-system`. If
None is given instead of a tuple, all of the image is
assumed.
N)Úloadr.Úconvertr3r4Úim)r rFÚboxs r
r4z Dib.paste¤s`€ð �‰Œ Ø �9‰9˜Ÿ™Ò Ø—‘˜DŸI™IÓ&ˆBÙ Ø �J‰J× Ñ ˜RŸU™U CÕ (à �J‰J× Ñ ˜RŸU™UÕ #rcó:—|jj|«y)zÐ
Load display memory contents from byte data.
:param buffer: A buffer containing display data (usually
data returned from :py:func:`~PIL.ImageWin.Dib.tobytes`)
N)r3Ú frombytes)r Úbuffers r
rIz
Dib.frombytesºs€ð
�