ImageSave Method (Stream, ImageOptionsBase)
Saves the image's data to the specified stream in the specified file format according to save options.

Namespace: Aspose.PSD
Assembly: Aspose.PSD (in Aspose.PSD.dll) Version: 20.6
Syntax
public void Save(
	Stream stream,
	ImageOptionsBase optionsBase
)

Parameters

stream
Type: System.IOStream
The stream to save the image's data to.
optionsBase
Type: Aspose.PSDImageOptionsBase
The save options.
Exceptions
ExceptionCondition
ArgumentNullExceptionoptionsBase
ArgumentExceptionCannot save to the specified format as it is not supported at the moment.;optionsBase
ImageSaveExceptionImage export failed.
Examples
This example shows the process of Saving an Image to MemoryStream. To demonstrate this operation, example loads an existing file from some disk location, performs Rotate operation on the image and Save the image in Gif format
[C#]

//Create an instance of MemoryStream
using (System.IO.MemoryStream stream = new System.IO.MemoryStream())
{
    //Create an instance of image class and initialize it with an existing file through File path
    using (Aspose.PSD.Image image = Aspose.PSD.Image.Load(@"C:\temp\image.psd"))
    {
        //Rotate the image at 180 degree about X axis
        image.RotateFlip(Aspose.PSD.RotateFlipType.Rotate180FlipX);

        //Save the Image as PSD to MemoryStream with default GifOptions settings
        image.Save(stream, new Aspose.PSD.ImageOptions.GifOptions());
    }
}
See Also