System.Drawing.Image.Save Method

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

Syntax

public void Save (string filename, System.Drawing.Imaging.ImageCodecInfo encoder, System.Drawing.Imaging.EncoderParameters encoderParams)

Parameters

filename
A string that contains the name of the file to which to save this System.Drawing.Image.
encoder
The System.Drawing.Imaging.ImageCodecInfo for this System.Drawing.Image.
encoderParams
An System.Drawing.Imaging.EncoderParameters to use for this System.Drawing.Image.

Remarks

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

Requirements

Namespace: System.Drawing
Assembly: System.Drawing (in System.Drawing.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0