VintaSoft Imaging .NET SDK 12.4: Documentation for .NET developer
Vintasoft.Imaging Namespace / VintasoftImage Class / Resolution Property
Syntax Exceptions Example Requirements SeeAlso
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 C#/VB.NET code 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: .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    See Also