Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
ImageTk.cpython-313.pyc86 linesDownload Raw Back to __pycache__
1�

2v�j� ���SSKJr SSKrSSKJr SSKJr SSKJrJ	r	 Sr3\4(aSSKJr SS	jr
SS5jr"SS5r"S
S5rSSjrg)�)�annotationsN)�BytesIO)�Any�)�Image�	ImageFileF)�CapsuleTypec��SnSU;aURS5nO SU;a[URS55nU(dg[R"U5$)N�file�data)�poprr�open)�kw�sources  �QD:\code\apps\devtools\python\user_packages\Python313\site-packages\PIL/ImageTk.py�_get_image_from_kwr+sI��
�F�
��|�������	�2��������(�����:�:�f���c��URnURX[U55 g![RaC SSKJn URUR55 URX[U55 gf=f)Nr)�6_imagingtk)	�tk�call�repr�tkinter�TclError�r�tkinit�7interpaddr)�command�photo�ptrrrs     r�_pyimagingtkcallr!6sd��8���B�+�9�����S�	�*�����+�	!����"�-�-�/�*�10�����S�	�*�
+�s�*�AB�Bc�j�\rSrSrSrSSSjjrS
SjrSSjrSSjrSSjr	SS	jr11S12rg)�13PhotoImage�Ia�14A Tkinter-compatible photo image.  This can be used15everywhere Tkinter expects an image object.  If the image is an RGBA16image, pixels having alpha 0 are treated as transparent.17 18The constructor takes either a PIL image, or a mode and a size.19Alternatively, you can use the ``file`` or ``data`` options to initialize20the photo image object.21 22:param image: Either a PIL image, or a mode string.  If a mode string is23              used, a size must also be given.24:param size: If the first argument is a mode string, this defines the size25             of the image.26:keyword file: A filename to load the image from (using27               ``Image.open(file)``).28:keyword data: An 8-bit string containing image data (as loaded from an29               image file).30Nc�f�Uc[U5nUc
Sn[U5e[U[5(aUnSnUc
Sn[U5eOrURnUS:XaIUR5 UR
5 UR(aURROSnURnUuUS'US'US;a[R"U5nXPlX l[R"S0UD6UlURR UlU(aUR#U5 gg)	N�Image is requiredz+If first argument is mode, size is required�P�RGB�width�height)�1�Lr(�RGBA�)r�31ValueError�32isinstance�str�mode�apply_transparency�load�palette�sizer�getmodebase�_PhotoImage__mode�_PhotoImage__sizerr#�_PhotoImage__photor�paste)�self�imager6r�msgr2s      r�__init__�PhotoImage.__init__]s���=�&�r�*�E��=�%�C��S�/�!�
��s�
#�
#��D��E��|�C�� ��o�%��33�:�:�D��s�{��(�(�*��34�35��-2�]�]�u�}�}�)�)����:�:�D�(,�%�B�w�K��H���0�0��$�$�T�*�D������)�)�/�B�/����,�,�/�/�����J�J�u��rc���URRnSURlURRR	SSU5 g![a gf=f![36a gf=f�Nr=�delete)r:�name�AttributeErrorrr�	Exception�r<rDs  r�__del__�PhotoImage.__del__��j��	��<�<�$�$�D�!�����	��L�L�O�O� � ��(�D�9��	�	��	��37�	��	��"�A�'A"�38A�A�"39A/�.A/c�,�[UR5$)z�40Get the Tkinter photo image identifier.  This method is automatically41called by Tkinter whenever a PhotoImage object is passed to a Tkinter42method.43 44:return: A Tkinter photo image identifier (a string).45)r1r:�r<s r�__str__�PhotoImage.__str__�����4�<�<� � rc� �URS$�z=46Get the width of the image.47 48:return: The width, in pixels.49r�r9rMs rr)�PhotoImage.width�����{�{�1�~�rc� �URS$�z?50Get the height of the image.51 52:return: The height, in pixels.53rrSrMs rr*�PhotoImage.height�rUrc�j�UR5nURnUR5(aURUR:waQ[54RRURUR5nURXC5 URn[SURU5 g)a55Paste a PIL image into the photo image.  Note that this can56be very slow if the photo image is displayed.57 58:param im: A PIL image. The size must match the target region.  If the59           mode does not match, the image is converted to the mode of60           the bitmap image.61�PyImagingPhotoN)
�getim�im�isblockr2r8r�core�	new_blockr6�convert2r r!r:)r<r\r r=�blocks     rr;�PhotoImage.paste�sv���h�h�j�������}�}���"�'�'�T�[�[�"8��J�J�(�(����b�g�g�>�E��N�N�5�(��)�)�C��)�4�<�<��=r)�__mode�__photo�__sizer)NN)r=zImage.Image | str | Noner6ztuple[int, int] | Nonerr�return�None�rfrg�rfr1�rf�int)r\�Image.Imagerfrg)�__name__�62__module__�__qualname__�__firstlineno__�__doc__r?rHrNr)r*r;�__static_attributes__r.rrr#r#IsT���*+/�'+�'�'�'�%�'��	'�6364�'�R	�!���>rr#c�N�\rSrSrSrS65SSjjrSSjrS
SjrS
SjrSSjr	S	r66g)�BitmapImage��a�67A Tkinter-compatible bitmap image.  This can be used everywhere Tkinter68expects an image object.69 70The given image must have mode "1".  Pixels having value 0 are treated as71transparent.  Options, if any, are passed on to Tkinter.  The most commonly72used option is ``foreground``, which is used to specify the color for the73non-transparent parts.  See the Tkinter documentation for information on74how to specify colours.75 76:param image: A PIL image.77Nc���Uc[U5nUc
Sn[U5eURUlURUl[R"SSUR50UD6Ul	g)Nr&rr.)78rr/r2�_BitmapImage__moder6�_BitmapImage__sizerrt�tobitmap�_BitmapImage__photo)r<r=rr>s    rr?�BitmapImage.__init__�s\���=�&�r�*�E��=�%�C��S�/�!��j�j����j�j����*�*�G����0@�G�B�G��rc���URRnSURlURRR	SSU5 g![a gf=f![79a gf=frB)rzrDrErrrFrGs  rrH�BitmapImage.__del__�rJrKc� �URS$rR�rxrMs rr)�BitmapImage.width�rUrc� �URS$rWrrMs rr*�BitmapImage.height�rUrc�,�[UR5$)z�80Get the Tkinter bitmap image identifier.  This method is automatically81called by Tkinter whenever a BitmapImage object is passed to a Tkinter82method.83 84:return: A Tkinter bitmap image identifier (a string).85)r1rzrMs rrN�BitmapImage.__str__�rPr)rcrdre)N)r=zImage.Image | Nonerrrfrgrhrjri)rmrnrorprqr?rHr)r*rNrrr.rrrtrt�s!���H�	���!rrtc��[R"SUR5UR545n[	SXR55 U$)z:Copies the contents of a PhotoImage to a PIL image memory.r-�PyImagingPhotoGet)r�newr)r*r!r[)rr\s  r�getimager�s9��	���6�E�K�K�M�5�<�<�>�:�	;�B��(�%����<�
�Ir)rzdict[str, Any]rfzImageFile.ImageFile | None)rr1rzPhotoImage | tkinter.PhotoImager r	rfrg)rr#rfrl)�86__future__rr�ior�typingrrrr�
TYPE_CHECKING�_typingr	rr!r#rtr�r.rr�<module>r�sh��6#������
��$��+�
�+�8�+�?J�+�	�+�&s>�s>�t>!�>!�Br
codekingpro/portable-devtools · Team Ai