Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
370
ArgumentOutofRangeException with ultraChart.SaveTo(stream, System.Drawing.Imaging.ImageFormat.Png, new Size(ultraChart.Width, ultraChart.Height), new SizeF(1f, 1f));
posted

Does anyone know the reason why ultraChart SaveTo method is throwing ArgumentOutofRangeException?. This method has been working for three months and all of a sudden started throwing this exception. Below is my code

private

ChartEntity GetChartImage(Infragistics.Win.UltraWinChart.UltraChart  ultraChart)
{
//generate chart
MemoryStream stream = new MemoryStream();
ultraChart.SaveTo(stream, System.Drawing.Imaging.
ImageFormat.Png, new Size(ultraChart.Width, ultraChart.Height), new SizeF(1f, 1f));
ChartEntity newEntity = new ChartEntity();
newEntity.Image =
Image.FromStream(stream);
return newEntity;

}