When using the Aspose.Cells ToImage function in order to convert it to an image, it just returns a null.
Expected: the surface chart should be converted to an image
Tuple<string, string> input = Tuple.Create("Chart 1", "\\Chart 1.png");
var imageOrPrintOptions = new ImageOrPrintOptions
{
Quality = 100,
VerticalResolution = 200,
HorizontalResolution = 200,
PrintingPage = PrintingPageType.IgnoreBlank,
ChartImageType = ImageFormat.Png,
OnePagePerSheet = true,
OnlyArea = true
};
using (FileStream fs = File.OpenRead(Server.MapPath("/File") + "\\Input.xlsx"))
{
var workbook = new Workbook(fs);
var chart = workbook.Worksheets["Sheet1"].Charts[input.Item1];
var image = chart.ToImage(imageOrPrintOptions);
image.Save(Server.MapPath("/File") + input.Item2, ImageFormat.Png);
};
I have attached the web app that reproduces the issue
WebAppAspose.zip (18.9 KB)