Version

SaveTo(String,ImageFormat) Method

Syntax
'Declaration
 
Public Overloads Overridable Sub SaveTo( _
   ByVal filePath As String, _
   ByVal imageType As ImageFormat _
) 
public virtual void SaveTo( 
   string filePath,
   ImageFormat imageType
)

Parameters

filePath
The full path and filename of the image that is being saved. The stream is kept open and it is up to application calling this method to close it.
imageType
The file format of the image, specified using ImageType enum.
Remarks

This method saves the current chart image to a local file on the server. When the file is saved, the filePath

Example
' create a stream to save the chart image to
Dim mS as New System.IO.MemoryStream()
' call the SaveTo method using the Stream and any ImageFormat
Me.UltraChart1.SaveTo(mS, System.Drawing.Imaging.ImageFormat.Bmp)
' it is possible to retrieve the image later using Image.FromStream
Dim myImage as System.Drawing.Image = System.Drawin.Image.FromStream(mS)

' or, just save the chart using a specified file path.
this.ultraChart1.SaveTo(Application.StartupPath & "\myChart.png", System.Drawing.Imaging.ImageFormat.Png)
// create a stream to save the chart image to
System.IO.MemoryStream mS = new System.IO.MemoryStream();
// call the SaveTo method using the Stream and any ImageFormat
this.ultraChart1.SaveTo(mS, System.Drawing.Imaging.ImageFormat.Bmp);
// it is possible to retrieve the image later using Image.FromStream
System.Drawing.Image myImage = System.Drawing.Image.FromStream(mS);

// or, just save the chart using a specified file path.
this.ultraChart1.SaveTo(Application.StartupPath + @"\myChart.png", System.Drawing.Imaging.ImageFormat.Png);
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also