to_image method

to_image(image_file, options)

Creates the shape image and saves it to a file. The extension of the file name determines the format of the image.

def to_image(self, image_file, options):
    ...
ParameterTypeDescription
image_filestrThe image file name with full path.
optionsaspose.diagram.saving.ImageSaveOptionsAdditional image creation options

Remarks

The format of the image is specified by using the extension of the file name. For example, if you specify “myfile.png”, then the image will be saved in the PNG format. The following file extensions are recognized: .bmp, .gif, .png, .jpg, .jpeg, .tiff, .tif, .emf.

to_image(stream, options)

Creates the shape image and saves it to a stream in the specified format.

def to_image(self, stream, options):
    ...
ParameterTypeDescription
streamio.RawIOBaseThe output stream.
optionsaspose.diagram.saving.ImageSaveOptionsAdditional image creation options

See Also