文件操作 - ImageDraw.cpython-311.pyc
返回文件管理
返回主菜单
删除本文件
文件: /usr/lib/python3/dist-packages/PIL/__pycache__/ImageDraw.cpython-311.pyc
编辑文件内容
� �"�c}� � � � d dl Z d dlZd dlZddlmZmZ ddlmZ G d� d� � Zdd�Z ej j Zn # e $ r dZY nw xY wd d�Zdd �Zd � Zd� ZdS )� N� )�Image� ImageColor)� deprecatec �F � e Zd ZdZd d�Zd� Zd d�Zd!d�Zd d�Zd"d�Z d"d �Z d#d�Zd$d�Zd"d �Z d d�Zd"d�Z d%d�Zd"d�Zd&d�Zd� Zd� Zd� Z d'd�Z d'd�Z d(d�Z d(d�Z d)d�Z d*d�Z d*d�ZdS )+� ImageDrawNc �P � |� � � |j r|� � � d}|�|j }||j k r%|dk r|j dk rd}nd}t |� � �|dk r |j | _ nd| _ || _ |j | _ t j � | j |� � | _ || _ |dv r | j � d� � | _ n| j � d � � | _ |d v rd| _ nd| _ d | _ dS )a� Create a drawing instance. :param im: The image to draw in. :param mode: Optional mode to use for color values. For RGB images, this argument can be RGB or RGBA (to blend the drawing into the image). For all other modes, this argument must be the same as the image mode. If omitted, the mode defaults to the mode of the image. r N�RGBA�RGBr z mode mismatch�P)�I�F���)�1r r r r �LF)�load�readonly�_copy�mode� ValueError�palette�_image�imr �core�draw�draw_ink�ink�fontmode�fill)�selfr r �blend�msgs �//usr/lib/python3/dist-packages/PIL/ImageDraw.py�__init__zImageDraw.__init__3 s � � ��� � � � �;� ��H�H�J�J�J����<��7�D��2�7�?�?��v�~�~�"�'�U�"2�"2����%�� ��o�o�%��3�;�;��:�D�L�L��D�L�����%����J�O�O�D�G�U�3�3�� ��� ��:����y�)�)�!�,�,�D�H�H��y�)�)�"�-�-�D�H��'�'�'��D�M�M��D�M��� � � � c �\ � | j sddlm} |� � � | _ | j S )a= Get the current default font. To set the default font for this ImageDraw instance:: from PIL import ImageDraw, ImageFont draw.font = ImageFont.truetype("Tests/fonts/FreeMono.ttf") To set the default font for all future ImageDraw instances:: from PIL import ImageDraw, ImageFont ImageDraw.ImageDraw.font = ImageFont.truetype("Tests/fonts/FreeMono.ttf") If the current default font is ``None``, it is initialized with ``ImageFont.load_default()``. :returns: An image font.r )� ImageFont)�font� r'