Image.Save Method (String, ImageCodecInfo, EncoderParameters)

Saves this Image to the specified file, with the specified encoder and image-encoder parameters.

Namespace: System.Drawing
Assembly: System.Drawing (in system.drawing.dll)

public:
void Save (
	String^ filename, 
	ImageCodecInfo^ encoder, 
	EncoderParameters^ encoderParams
)
public void Save (
	String filename, 
	ImageCodecInfo encoder, 
	EncoderParameters encoderParams
)
public function Save (
	filename : String, 
	encoder : ImageCodecInfo, 
	encoderParams : EncoderParameters
)
Not applicable.

Parameters

filename

A string that contains the name of the file to which to save this Image.

encoder

The ImageCodecInfo for this Image.

encoderParams

An EncoderParameters to use for this Image.

Exception typeCondition

ArgumentNullException

filename or encoder is null.

ExternalException

The image was saved with the wrong image format.

-or-

The image was saved to the same file it was created from.

Saving the image to the same file it was constructed from is not allowed and throws an exception.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show: