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•ãó‚ddlmZddlmZGdd«ZGdd«ZGdd «ZGd
d «ZGd d
e«Zy)é)Ú annotationsé)ÚImagecó eZdZdZddZddZy)Ú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©Ú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ó eZdZdZddZddZy)Ú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óveZdZdZ d
d dZd dZ d
d
dZddZ d
ddZddZ 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)z+If first argument is mode, size is required)ÚRGB) Ú
isinstanceÚstrÚ
ValueErrorÚmodeÚsizerÚ getmodebaseÚcoreÚdisplayÚimageÚpaste)r r3r/r.Úmsgs r
rz Dib.__init__Hô eœSÔ ˆD؈E؈|ØCÜ  “oЗ:‘:ˆDØ—:‘:ˆDØ Ð ×$ *ˆ—ZZרdÓ3ˆŒ
؈Œ ؈Œ Ù Ü! %¬Ô  J‰J ð rcóZt|«}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ð

×! 
×$ Z°Õ 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ð

  Ô
×$ Õ J‰JO‰O˜J¨¨SÕ 1øð
×$ Õ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×% 1ˆ
Ÿ×1°&Ó9à
×$ V¨VÔˆ
ð—Z‘Z×-¨jÓ9ˆF؈
øð
×$ V¨VÕ4ús ¸BÂB,có(|j«|j|jk7r|j|j«}|r'|jj |j
|«y|jj |j
«y)
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)
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ð