to_image method
Contents
[
Hide
]to_image
Creates the shape image and saves it to a stream in the specified format.
def to_image(self, stream, image_type):
...
Parameter | Type | Description |
---|---|---|
stream | io.RawIOBase | The output stream. |
image_type | ImageType | The type in which to save the image. |
Remarks
The following formats are supported: .bmp, .gif, .jpg, .jpeg, .tiff, .emf.
Example
from aspose.cells.drawing import ImageType
from io import BytesIO
imageStream = BytesIO()
shape.to_image(imageStream, ImageType.PNG)
to_image
Saves the shape to a file.
def to_image(self, image_file, options):
...
Parameter | Type | Description |
---|---|---|
image_file | str | |
options | aspose.cells.rendering.ImageOrPrintOptions |
Example
from aspose.cells.rendering import ImageOrPrintOptions
op = ImageOrPrintOptions()
shape.to_image("exmaple.png", op)
to_image
Saves the shape to a stream.
def to_image(self, stream, options):
...
Parameter | Type | Description |
---|---|---|
stream | io.RawIOBase | |
options | aspose.cells.rendering.ImageOrPrintOptions |
Example
from aspose.cells.rendering import ImageOrPrintOptions
from io import BytesIO
imageStream = BytesIO()
op = ImageOrPrintOptions()
shape.to_image(imageStream, op)
See Also
- module
aspose.cells.drawing
- class
SmartArtShape