Hello,
We’re using the .NET Standard 2.0 variant of Aspose.Cells (v21.12.0).
It appears that some overloads for the SheetRender class are missing. According to the API documentation, there should be five overloads for the ToImage method:
ToImage(Int32) Render certain page to a Bitmap object.
ToImage(Int32, Stream) Render certain page to a stream.
ToImage(Int32, String) Render certain page to a file.
ToImage(Int32, Graphics, Single, Single) Render certain page to a Graphics
ToImage(Int32, Graphics, Single, Single, Single, Single) Render certain page to a Graphics
However, only the second and third methods are available (to stream and to file). The first, fourth and fifth methods are not available (to bitmap and to graphics).
It can be tested with the following code:
Workbook workbook = new Workbook("Test.xlsx");
Worksheet sheet = workbook.Worksheets[0];
ImageOrPrintOptions options = new ImageOrPrintOptions();
options.ImageType = ImageType.Png;
var sr = new SheetRender(sheet, options);
// Missing overload #1
Bitmap bitmap = sr.ToImage(0);
// Missing overload #2
Graphics g1 = Graphics.FromImage(new Bitmap(800, 600));
sr.ToImage(0, g1, 0, 0);
// Missing overload #3
Graphics g2 = Graphics.FromImage(new Bitmap(800, 600));
sr.ToImage(0, g2, 0, 0, 500, 400);
Is there something wrong in our code? Or can you add the missing methods?