Aspose::Cells::Charts::Chart::ToImage method

Chart::ToImage(const U16String&) method

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

void Aspose::Cells::Charts::Chart::ToImage(const U16String &imageFile)
ParameterTypeDescription
imageFileconst U16String&The image file name with full path.

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.

If the width or height is zero or the chart is not supported according to Supported Charts List, this method will do nothing.

See Also

Chart::ToImage(const char16_t*) method

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

void Aspose::Cells::Charts::Chart::ToImage(const char16_t *imageFile)
ParameterTypeDescription
imageFileconst char16_t*The image file name with full path.

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.

If the width or height is zero or the chart is not supported according to Supported Charts List, this method will do nothing.

See Also

Chart::ToImage(const U16String&, Aspose::Cells::Drawing::ImageType) method

Creates the chart image and saves it to a file in the specified image type.

void Aspose::Cells::Charts::Chart::ToImage(const U16String &imageFile, Aspose::Cells::Drawing::ImageType imageType)
ParameterTypeDescription
imageFileconst U16String&The image file name with full path.
imageTypeAspose::Cells::Drawing::ImageTypeThe image type in which to save the image.

Remarks

The type of the image is specified by using imageType. The following types are supported: ImageType.Bmp, ImageType.Gif, ImageType.Png, ImageType.Jpeg, ImageType.Tiff, ImageType.Emf.

If the width or height is zero or the chart is not supported according to Supported Charts List, this method will do nothing.

See Also

Chart::ToImage(const char16_t*, Aspose::Cells::Drawing::ImageType) method

Creates the chart image and saves it to a file in the specified image type.

void Aspose::Cells::Charts::Chart::ToImage(const char16_t *imageFile, Aspose::Cells::Drawing::ImageType imageType)
ParameterTypeDescription
imageFileconst char16_t*The image file name with full path.
imageTypeAspose::Cells::Drawing::ImageTypeThe image type in which to save the image.

Remarks

The type of the image is specified by using imageType. The following types are supported: ImageType.Bmp, ImageType.Gif, ImageType.Png, ImageType.Jpeg, ImageType.Tiff, ImageType.Emf.

If the width or height is zero or the chart is not supported according to Supported Charts List, this method will do nothing.

See Also

Chart::ToImage(const U16String&, int64_t) method

Creates the chart image and saves it to a file in the Jpeg format.

void Aspose::Cells::Charts::Chart::ToImage(const U16String &imageFile, int64_t jpegQuality)
ParameterTypeDescription
imageFileconst U16String&The image file name with full path.
jpegQualityint64_tJpeg quality.

Remarks

If the width or height is zero or the chart is not supported according to Supported Charts List, this method will do nothing.

See Also

Chart::ToImage(const char16_t*, int64_t) method

Creates the chart image and saves it to a file in the Jpeg format.

void Aspose::Cells::Charts::Chart::ToImage(const char16_t *imageFile, int64_t jpegQuality)
ParameterTypeDescription
imageFileconst char16_t*The image file name with full path.
jpegQualityint64_tJpeg quality.

Remarks

If the width or height is zero or the chart is not supported according to Supported Charts List, this method will do nothing.

See Also

Chart::ToImage(int64_t) method

Creates the chart image and saves it to a stream in the Jpeg format.

Vector<uint8_t> Aspose::Cells::Charts::Chart::ToImage(int64_t jpegQuality)
ParameterTypeDescription
streamint64_tThe output stream.

Remarks

If the width or height is zero or the chart is not supported according to Supported Charts List, this method will do nothing.

See Also

Chart::ToImage(Aspose::Cells::Drawing::ImageType) method

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

Vector<uint8_t> Aspose::Cells::Charts::Chart::ToImage(Aspose::Cells::Drawing::ImageType imageType)
ParameterTypeDescription
streamAspose::Cells::Drawing::ImageTypeThe output stream.

Remarks

The type of the image is specified by using imageType. The following types are supported: ImageType.Bmp, ImageType.Gif, ImageType.Png, ImageType.Jpeg, ImageType.Tiff, ImageType.Emf.

If the width or height is zero or the chart is not supported according to Supported Charts List, this method will do nothing.

See Also

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

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

void Aspose::Cells::Charts::Chart::ToImage(const U16String &imageFile, const ImageOrPrintOptions &options)
ParameterTypeDescription
imageFileconst U16String&The image file name with full path.
optionsconst ImageOrPrintOptions&Additional 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.

If the width or height is zero or the chart is not supported according to Supported Charts List, this method will do nothing. Please refer to Supported Charts List for more details.

Examples

Aspose::Cells::Startup();
//Saves to Tiff with 300 dpi and CCITT4 compression.

ImageOrPrintOptions opt;
opt.SetHorizontalResolution(300);
opt.SetVerticalResolution(300);
opt.SetTiffCompression(TiffCompression::CompressionCCITT4);

Workbook book(u"test.xls");
book.GetWorksheets().Get(0).GetCharts().Get(0).ToImage(u"chart.Tiff", opt);



//Saves to Jpeg with 300 dpi and 80 image quality.

ImageOrPrintOptions options2;
options2.SetHorizontalResolution(300);
options2.SetVerticalResolution(300);
options2.SetQuality(80);

U16String val = u"chart.Jpeg";
Workbook book2(u"test.xls");
book2.GetWorksheets().Get(0).GetCharts().Get(0).ToImage(val, opt);
Aspose::Cells::Cleanup();

See Also

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

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

void Aspose::Cells::Charts::Chart::ToImage(const char16_t *imageFile, const ImageOrPrintOptions &options)
ParameterTypeDescription
imageFileconst char16_t*The image file name with full path.
optionsconst ImageOrPrintOptions&Additional 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.

If the width or height is zero or the chart is not supported according to Supported Charts List, this method will do nothing. Please refer to Supported Charts List for more details.

Examples

Aspose::Cells::Startup();
//Saves to Tiff with 300 dpi and CCITT4 compression.

ImageOrPrintOptions opt;
opt.SetHorizontalResolution(300);
opt.SetVerticalResolution(300);
opt.SetTiffCompression(TiffCompression::CompressionCCITT4);

Workbook book(u"test.xls");
book.GetWorksheets().Get(0).GetCharts().Get(0).ToImage(u"chart.Tiff", opt);



//Saves to Jpeg with 300 dpi and 80 image quality.

ImageOrPrintOptions options2;
options2.SetHorizontalResolution(300);
options2.SetVerticalResolution(300);
options2.SetQuality(80);

Workbook book2(u"test.xls");
book2.GetWorksheets().Get(0).GetCharts().Get(0).ToImage(u"chart.Jpeg", opt);


Aspose::Cells::Cleanup();

See Also

Chart::ToImage(const ImageOrPrintOptions&) method

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

Vector<uint8_t> Aspose::Cells::Charts::Chart::ToImage(const ImageOrPrintOptions &options)
ParameterTypeDescription
streamconst ImageOrPrintOptions&The output stream.

Remarks

The type of the image is specified by using options.ImageType. The following formats are supported: ImageType.Bmp, ImageType.Gif, ImageType.Png, ImageType.Jpeg, ImageType.Tiff, ImageType.Emf.

If the width or height is zero or the chart is not supported according to Supported Charts List, this method will do nothing. Please refer to Supported Charts List for more details.

Examples

Aspose::Cells::Startup();
//Gets a bitmap object with 200 x dpi and 300 y dpi.

ImageOrPrintOptions opt;
opt.SetHorizontalResolution(200);
opt.SetVerticalResolution(300);

Workbook book(u"test.xls");
Vector<uint8_t> chartObject = book.GetWorksheets().Get(0).GetCharts().Get(0).ToImage(opt);
Aspose::Cells::Cleanup();

See Also