to_image metod

to_image

Skapar formbilden och sparar den i en ström i det angivna formatet.

def to_image(self, stream, image_type):
    ...
ParameterTypBeskrivning
streamio.RawIOBaseUtgångsströmmen.
image_typeImageTypeTypen där bilden ska sparas.

Anmärkningar

Följande format stöds: .bmp, .gif, .jpg, .jpeg, .tiff, .emf.

Exempel

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

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

to_image

Sparar formen till en fil.

def to_image(self, image_file, options):
    ...
ParameterTypBeskrivning
image_filestr
optionsaspose.cells.rendering.ImageOrPrintOptions

Exempel

from aspose.cells.rendering import ImageOrPrintOptions

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

to_image

Sparar formen till en ström.

def to_image(self, stream, options):
    ...
ParameterTypBeskrivning
streamio.RawIOBase
optionsaspose.cells.rendering.ImageOrPrintOptions

Exempel

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

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

Se även