Aspose::Cells::Rendering::SheetRender::ToImage method

SheetRender::ToImage(int32_t, const U16String&) method

Render certain page to a file.

void Aspose::Cells::Rendering::SheetRender::ToImage(int32_t pageIndex, const U16String &fileName)
ParameterTypeDescription
pageIndexint32_tindicate which page is to be converted
fileNameconst U16String&filename of the output image

Examples

Aspose::Cells::Startup();
//The following code outputs the first page of the first sheet to png image.

//load the source file with images.
Workbook wb(u"Book1.xlsx");

ImageOrPrintOptions imgOpt;

//set output image type.
imgOpt.SetImageType(ImageType::Png);

//render the first sheet.
SheetRender sr(wb.GetWorksheets().Get(0), imgOpt);

//output the first page of the sheet to image.
U16String val =  u"output.png";
sr.ToImage(0, val);
Aspose::Cells::Cleanup();

See Also

SheetRender::ToImage(int32_t, const char16_t*) method

Render certain page to a file.

void Aspose::Cells::Rendering::SheetRender::ToImage(int32_t pageIndex, const char16_t *fileName)
ParameterTypeDescription
pageIndexint32_tindicate which page is to be converted
fileNameconst char16_t*filename of the output image

Examples

Aspose::Cells::Startup();
//The following code outputs the first page of the first sheet to png image.

//load the source file with images.
Workbook wb(u"Book1.xlsx");

ImageOrPrintOptions imgOpt;

//set output image type.
imgOpt.SetImageType(ImageType::Png);

//render the first sheet.
SheetRender sr(wb.GetWorksheets().Get(0), imgOpt);

//output the first page of the sheet to image.
sr.ToImage(0, u"output.png");
Aspose::Cells::Cleanup();

See Also

SheetRender::ToImage(int32_t) method

Render certain page to a stream.

Vector<uint8_t> Aspose::Cells::Rendering::SheetRender::ToImage(int32_t pageIndex)
ParameterTypeDescription
pageIndexint32_tindicate which page is to be converted

See Also