AccessViolationException when converting chart to image

Hi Kostas,

Thanks for using Aspose.Cells.

We created a simple project which is not dependent on Aspose.Cells to reproduce the AccessVoilationException.

As MSDN (http://msdn.microsoft.com/en-us/library/windows/desktop/ms684256(v=vs.85).aspx) says, multiple threads can’t share GDI+ objects. So we must lock the drawing function, like TestLock() method in SimpleTest.

We try to separate the GDI objects using in Chart.ToImage() and add a lock for every one of them, but didn’t succeed. There are too many GDI objects being used in ToImage(), we even can’t discriminate them. You may add a lock to Chart.ToImage() method.