this.ultraDataChart1.SaveTo("chart.jpeg", System.Drawing.Imaging.ImageFormat.Jpeg);
This topic demonstrates the usage of the SaveTo method of the UltraDataChart.
The following topics are prerequisites to understanding this topic:
This topic contains the following sections:
The SaveTo method of the UltraDataChart can be used to render the chart’s image to a file or a stream.
The following are code snippets demonstrating how to use the SaveTo functionality of the UltraDataChart.
To save to a file, a path and an image format need to be specified. The following line of code saves the chart to a JPEG image file:
In C#:
this.ultraDataChart1.SaveTo("chart.jpeg", System.Drawing.Imaging.ImageFormat.Jpeg);
In Visual Basic:
Me.UltraDataChart1.SaveTo("chart.jpeg", System.Drawing.Imaging.ImageFormat.Jpeg)
The chart’s binary image data can also be saved to a stream. In this case, the stream and the image format must be specified:
In C#:
this.ultraDataChart1.SaveTo(stream, System.Drawing.Imaging.ImageFormat.Jpeg);
In Visual Basic:
Me.UltraDataChart1.SaveTo(stream, System.Drawing.Imaging.ImageFormat.Jpeg)
The following topics provide additional information related to this topic: