Hello,
I’m trying to get image from any Pie Chart. However, I got an error with NullReference exception on IShape.GetThumbnail method calling. As result it’s empty image. The same behavior with WriteAsSvg method.
If change chart type to another type (line, for example) all will be ok. Aspose.Slides for .NET v21.5.0
Pie chart.zip (132.9 KB)
Code example:
foreach (Slide slide in presentation.Slides)
{
var pieCharts = slide.Shapes.Where(_ => _ is Chart chart && chart.Type == ChartType.Pie).Select(_ => (Chart)_);
var i = 0;
foreach (var pieChart in pieCharts)
{
using (var bmp = pieChart.GetThumbnail()) // NullReference Exception there
{
bmp.Save(string.Format(@"C:\temp\pie-chart{0}.jpeg", i), System.Drawing.Imaging.ImageFormat.Jpeg);
i++;
}
}
}