VintaSoft Imaging .NET SDK v8.7
Vintasoft.Imaging Namespace / VintasoftImage Class / Save Method / Save(String) Method
Filename where the image should be saved.
Example



In This Topic
    Save(String) Method
    In This Topic
    Saves this VintasoftImage object to the specified file.
    Syntax
    'Declaration
     
    Public Overloads Sub Save( _
       ByVal filename As String _
    ) 
    public void Save( 
       string filename
    )
    public: void Save( 
       string* filename
    ) 
    public:
    void Save( 
       String^ filename
    ) 

    Parameters

    filename
    Filename where the image should be saved.
    Exceptions
    ExceptionDescription
    Thrown if filename is null.
    Thrown if encoder is not found for specified file extension or error occurs at saving the image.
    Remarks
    Supported image formats: BMP, GIF, JBIG2, JPEG, PCX, PDF, PNG, TIFF.

    Suitable encoder is selected automatically from the extension of the filename, exception is thrown if encoder is not found for file extension specified in filename.

    If image is saving to new file (filename != SourceInfo.Filename) this method:
    • saves image to new BMP/GIF/JBIG2/JPEG/PCX/PDF/PNG/TIFF file

    If image is saving to the source file (filename == SourceInfo.Filename) this method:
    • saves image to the source BMP/GIF/JBIG2/JPEG/PCX/PDF/PNG/TIFF file if image is changed (IsChanged = true) and source file contains only one image
    • throws an exception if image is saved to the source GIF/JBIG2/PDF/TIFF file, image is changed (IsChanged = true) and source file contains some images
    • throws an exception if image is saved to the source image file and image is not changed (IsChanged = false)
    Example
    This example shows how to load image from TIFF file and save it as JPEG file.
    ' load image from file
    Using image As New Vintasoft.Imaging.VintasoftImage("c:\original-image.tif")
    	' save image to the file
    	image.Save("c:\converted-image.jpg")
    End Using
    // load image from file
    using (Vintasoft.Imaging.VintasoftImage image =
        new Vintasoft.Imaging.VintasoftImage(@"c:\original-image.tif"))
    {
        // save image to the file
        image.Save(@"c:\converted-image.jpg");
    }
    Requirements

    Target Platforms: Windows 10, Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2012, Windows Server 2008, Windows Server 2003

    See Also