1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
Ë
³òúhŒ ãó‚—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  ú?H:\Change_password\venv_build\Lib\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€ð     
‰
×јVÕ$rcó6—|jj«S)zy
        Copy display memory contents to bytes object.
 
        :return: A bytes object containing display data.
        )r3Útobytesrs r rLz Dib.tobytesÃs€ð z‰z×!Ñ!Ó#Ð#rr    )r3zImage.Image | strr/ztuple[int, int] | Nonerr)r:úint | HDC | HWNDrr)r:rMr>ztuple[int, int, int, int]r?ú tuple[int, int, int, int] | Nonerr)r:rMrr)rFz Image.ImagerGrNrr)rJÚbytesrr)rrO) rrrrrr8r=rAr4rIrLrrr r$r$4s“„ñð(HLðØ&ðØ.Dðà     óó**ð,15ð    2à ð2ð'ð2ð.ð    2ð
 
ó 2ó6ð6HLð$Øð$Ø$Dð$à     ó$ó,%ô$rr$cób—eZdZdZ    d                             d d„Zd d„Zdd„Zdd„Zdd„Zdd„Z    dd    „Z
dd
„Z y)ÚWindowz*Create a Window with the given title size.Ncóv—tjj||j|xsd|xsd«|_y)Nr)rr1Ú createwindowÚ_Window__dispatcherÚhwnd)r ÚtitleÚwidthÚheights    r rzWindow.__init__Ïs1€ô—J‘J×+Ñ+Ø 4×$Ñ$ e¢j¨q°&²+¸Aó
ˆ    rcó(—t|d|›«|Žy)NÚ
ui_handle_)Úgetattr)r ÚactionÚargss   r Ú __dispatcherzWindow.__dispatcherÖs€Ø,Œ˜
 6 (Ð+Ó,¨dÒ3rcó—yr    r©r r Úx0Úy0Úx1Úy1s      r Úui_handle_clearzWindow.ui_handle_clearÙó€Ø rcó—yr    r)r rarbrcrds     r Úui_handle_damagezWindow.ui_handle_damageÜrfrcó—yr    rrs r Úui_handle_destroyzWindow.ui_handle_destroyßrfrcó—yr    rr`s      r Úui_handle_repairzWindow.ui_handle_repairârfrcó—yr    r)r rWrXs   r Úui_handle_resizezWindow.ui_handle_resizeårfrcó@—tjj«yr    )rr1Ú    eventlooprs r ÚmainloopzWindow.mainloopès€Ü 
‰
×ÑÕr)ÚPILNN)rVr,rWú
int | NonerXrsrr)r\r,r]rrr© r rrarrbrrcrrdrrr)
rarrbrrcrrdrrr)rr)rWrrXrrr) rrrrrrTrerhrjrlrnrqrrr rQrQÌsT„Ù4ðRVð
Øð
Ø)3ð
ØDNð
à     ó
ó4ó ó ó ó ó ôrrQcó.‡—eZdZdZddˆfd„ Zdd„ZˆxZS)Ú ImageWindowz6Create an image window which displays the given image.c󌕗t|t«s t|«}||_|j\}}t‰||||¬«y)N)rWrX)r+r$r3r/Úsuperr)r r3rVrWrXÚ    __class__s     €r rzImageWindow.__init__ïs>ø€Ü˜%¤Ô%ܘ“JˆE؈Œ
ØŸ
™
‰ ˆˆvÜ ‰Ñ˜ e°FÐÕ;rcóD—|jj|||||f«yr    )r3r=r`s      r rlzImageWindow.ui_handle_repairös€Ø 
‰
‰˜˜R  R¨Ð,Õ-r)rr)r3zImage.Image | DibrVr,rrrt)rrrrrrlÚ __classcell__)rys@r rvrvìsø„Ù@ö<÷.rrvN)    Ú
__future__rr&rrrr$rQrvrrr ú<module>r}sEðõ&#å÷ ñ ÷ ñ ÷U$ñU$÷pñô@ .&õ .r