VintaSoft Imaging .NET SDK v8.6
Vintasoft.Imaging Namespace / VintasoftImage Class / Resolution Property
Example



In This Topic
    Resolution Property (VintasoftImage)
    In This Topic
    Gets or sets the resolution, in pixels per inch, of this image.
    Syntax
    'Declaration
     
    Public Property Resolution As Resolution
    public Resolution Resolution {get; set;}
    public: __property Resolution get_Resolution();
    public: __property void set_Resolution( 
       Resolution value
    );
    public:
    property Resolution Resolution {
       Resolution get();
       void set (    Resolution value);
    }

    Property Value

    Valid values are from 1 to 12800.
    Exceptions
    ExceptionDescription
    Thrown if new resolution is less than 1.
    Thrown if IsVectorImage set to true.
    Example
    This example shows how to load image from disk, change its resolution and save to new image file.
    Using image As New Vintasoft.Imaging.VintasoftImage("c:\original-image.jpg")
        Try
            image.Resolution = New Vintasoft.Imaging.Resolution(250F, 250F)
            image.Save("c:\processed-image.jpg")
                ' show message with error
        Catch generatedExceptionName As Vintasoft.Imaging.ImageProcessing.ImageProcessingException
        End Try
    End Using
    using (Vintasoft.Imaging.VintasoftImage image =
        new Vintasoft.Imaging.VintasoftImage(@"c:\original-image.jpg"))
    {
        try
        {
            image.Resolution = new Vintasoft.Imaging.Resolution(250f, 250f);
            image.Save(@"c:\processed-image.jpg");
        }
        catch (Vintasoft.Imaging.ImageProcessing.ImageProcessingException)
        {
            // show message with error
        }
    }
    Requirements

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

    See Also