Bitmap.Save

Save(string)

Saves this Image to the specified file or stream.

public void Save(string filename)
ParameterTypeDescription
filenameStringA string that contains the name of the file to which to save this Image.

Exceptions

exceptioncondition
ArgumentNullExceptionfilename is null.
ExternalExceptionThe image was saved with the wrong image format.-or- The image was saved to the same file it was created from.

See Also


Save(string, ImageFormat)

Saves this Image to the specified file in the specified format.

public void Save(string filename, ImageFormat format)
ParameterTypeDescription
filenameStringA string that contains the name of the file to which to save this Image.
formatImageFormatThe ImageFormat for this Image.

Exceptions

exceptioncondition
ArgumentNullExceptionfilename or format is null.
ExternalExceptionThe image was saved with the wrong image format.-or- The image was saved to the same file it was created from.

See Also


Save(Stream, ImageFormat)

Saves this image to the specified stream in the specified format.

public void Save(Stream stream, ImageFormat format)
ParameterTypeDescription
streamStreamThe Stream where the image will be saved.
formatImageFormatAn ImageFormat that specifies the format of the saved image.

Exceptions

exceptioncondition
ArgumentNullExceptionstream or format is null.
ExternalExceptionThe image was saved with the wrong image format

See Also