طريقة to_image

to_image(self, stream, image_type)

إنشاء صورة الشكل وحفظها في مجرى بالتنسيق المحدد.


def to_image(self, stream, image_type):
    ...
معامليكتبوصف
streamio.RawIOBaseتيار الإخراج.
image_typeImageTypeالنوع الذي تريد حفظ الصورة فيه.

ملاحظات

يتم دعم التنسيقات التالية: .bmp، .gif، .jpg، .jpeg، .tiff، .emf.

مثال

from aspose.cells.drawing import ImageType
from io import BytesIO

imageStream = BytesIO()
shape.to_image(imageStream, ImageType.PNG)

to_image(self, image_file, options)

يحفظ الشكل في ملف.


def to_image(self, image_file, options):
    ...
معامليكتبوصف
image_filestr
optionsaspose.cells.rendering.ImageOrPrintOptions

مثال

from aspose.cells.rendering import ImageOrPrintOptions

op = ImageOrPrintOptions()
shape.to_image("exmaple.png", op)

to_image(self, stream, options)

يحفظ الشكل في مجرى.


def to_image(self, stream, options):
    ...
معامليكتبوصف
streamio.RawIOBase
optionsaspose.cells.rendering.ImageOrPrintOptions

مثال

from aspose.cells.rendering import ImageOrPrintOptions
from io import BytesIO

imageStream = BytesIO()
op = ImageOrPrintOptions()
shape.to_image(imageStream, op)

أنظر أيضا