Chart.SaveImage Method

Definition

Saves the chart image to a stream or a file.

Overloads

SaveImage(String, ChartImageFormat)

Saves a chart image to the file.

SaveImage(Stream, ChartImageFormat)

Saves the chart image to the specified stream.

SaveImage(Stream)

Saves the chart image to the specified stream. The properties ImageType, Compression and other Chart control properties are used.

SaveImage(String)

Saves the chart image to the specified file. The properties ImageType, Compression and other Chart control properties are used.

SaveImage(String, ChartImageFormat)

Saves a chart image to the file.

C#
public void SaveImage(string imageFileName, System.Web.UI.DataVisualization.Charting.ChartImageFormat format);

Parameters

imageFileName
String

The image file name.

format
ChartImageFormat

The chart image format.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SaveImage(Stream, ChartImageFormat)

Saves the chart image to the specified stream.

C#
public void SaveImage(System.IO.Stream imageStream, System.Web.UI.DataVisualization.Charting.ChartImageFormat format);

Parameters

imageStream
Stream

The image stream.

format
ChartImageFormat

The chart image format.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SaveImage(Stream)

Saves the chart image to the specified stream. The properties ImageType, Compression and other Chart control properties are used.

C#
public void SaveImage(System.IO.Stream imageStream);

Parameters

imageStream
Stream

The image stream.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

SaveImage(String)

Saves the chart image to the specified file. The properties ImageType, Compression and other Chart control properties are used.

C#
public void SaveImage(string imageFileName);

Parameters

imageFileName
String

The image file name.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1