I have a very simple excel document with a chart, but when I call chart.ToImage() I receive an overflow error (Cells 4.4.0.18)
When running in debug mode, the error is _COMPlusExceptionCode = -532459699, catching that and showing the full stacktrace is:
A first chance exception of type 'System.OverflowException' occurred in System.Drawing.dll
at System.Drawing.Graphics.CheckErrorStatus(Int32 status)
at System.Drawing.Graphics.FillPath(Brush brush, GraphicsPath path)
at Aspose.Charts.ChartHelpers.۱.ܜ(Graphics ә, Ӟ ӕ, ܗ, PointF[] ּ, Single Վ)
at Aspose.Charts.ChartHelpers.۱.ܖ(Graphics ә, ܗ, Ӟ ӕ, Single ܐ, Single ܑ, Single ܘ, Single ۳, Single Վ)
at Aspose.Charts.ChartHelpers.۱.܋(Graphics ә, Ӟ ӕ, Double ۴, Int32 ٞ)
at Aspose.Charts.ChartHelpers.ۓ.Ә(Ӟ ӕ)
at Aspose.Charts.ChartHelpers.۩.Render(Ӟ chart)
at Aspose.Charts.Ӟ.Render()
at Aspose.Cells.᪪.᪭(Chart ӕ)
at Aspose.Cells.Chart.ToImage()
Sample attached - the code I use (which works for all my other test files) is
foreach (Worksheet sheet in _workbook.Worksheets)
{
//Charts
foreach (Chart chart in sheet.Charts)
{
try
{
System.Drawing.Bitmap bitmap = chart.ToImage();