Aspose::Cells::Drawing::Shape::ToImage method

Shape::ToImage(const Vector <uint8_t>&, Aspose::Cells::Drawing::ImageType) method

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

void Aspose::Cells::Drawing::Shape::ToImage(const Vector<uint8_t> &stream, Aspose::Cells::Drawing::ImageType imageType)
ParameterTypeDescription
streamconst Vector <uint8_t>&The output stream.
imageTypeAspose::Cells::Drawing::ImageTypeThe type in which to save the image.

Remarks

The following formats are supported: .bmp, .gif, .jpg, .jpeg, .tiff, .emf.

Examples

Vector<uint8_t> imageStream {0};
shape.ToImage(imageStream, ImageType::Png);

See Also

Shape::ToImage(const U16String&, const ImageOrPrintOptions&) method

Saves the shape to a file.

void Aspose::Cells::Drawing::Shape::ToImage(const U16String &imageFile, const ImageOrPrintOptions &options)

Examples

U16String imgFile = u"exmaple.png";
ImageOrPrintOptions op;
shape.ToImage(imgFile, op);

See Also

Shape::ToImage(const char16_t*, const ImageOrPrintOptions&) method

Saves the shape to a file.

void Aspose::Cells::Drawing::Shape::ToImage(const char16_t *imageFile, const ImageOrPrintOptions &options)

Examples

ImageOrPrintOptions op;
shape.ToImage(u"exmaple.png", op);

See Also

Shape::ToImage(const ImageOrPrintOptions&) method

Saves the shape to a stream.

Vector<uint8_t> Aspose::Cells::Drawing::Shape::ToImage(const ImageOrPrintOptions &options)

Examples

ImageOrPrintOptions op;
Vector<uint8_t> imageStream = shape.ToImage(op);

See Also