Image.CanSave

Image.CanSave method

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

public bool CanSave(ImageOptionsBase options)
ParameterTypeDescription
optionsImageOptionsBaseThe save options to use.

Return Value

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