ImageCanSave Method
Determines whether image can be saved to the specified file format represented by the passed save options.

Namespace: Aspose.Imaging
Assembly: Aspose.Imaging (in Aspose.Imaging.dll) Version: 20.06
Syntax
public bool CanSave(
	ImageOptionsBase options
)

Parameters

options
Type: Aspose.ImagingImageOptionsBase
The save options to use.

Return Value

Type: Boolean
true if image can be saved to the specified file format represented by the passed save options; otherwise, false.
Examples
This example shows how to determine whether image can be saved to the specified file format represented by the passed save options.
[C#]

string dir = "c:\\temp\\";

using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(dir + "sample.gif"))
{
    Aspose.Imaging.ImageOptions.JpegOptions saveOptions = new Aspose.Imaging.ImageOptions.JpegOptions();
    saveOptions.Quality = 50;

    // Determine whether the image can be saved to Jpeg
    bool canSave = image.CanSave(saveOptions);
}
See Also