VintaSoft Imaging .NET SDK 14.0: Documentation for .NET developer
Vintasoft.Imaging.ImageProcessing.Transforms Namespace / QuadrilateralWarpCommand Class / IsInverseTransform Property
Syntax Remarks Example Requirements SeeAlso
In This Topic
    IsInverseTransform Property (QuadrilateralWarpCommand)
    In This Topic
    Gets or sets a value indicating whether command must work as inverse transform.
    Syntax
    'Declaration
    
    <DefaultValueAttribute(False)>
    <DescriptionAttribute("The value indicating whether command must work as inverse transform.")>
    Public Property IsInverseTransform As Boolean
    
    
    [DefaultValue(False)]
    [Description("The value indicating whether command must work as inverse transform.")]
    public bool IsInverseTransform { get; set; }
    
    
    [DefaultValue(False)]
    [Description("The value indicating whether command must work as inverse transform.")]
    public: __property bool get_IsInverseTransform();
    public: __property void set_IsInverseTransform(
    bool value
    );
    [DefaultValue(False)]
    [Description("The value indicating whether command must work as inverse transform.")]
    public:
    property bool IsInverseTransform { bool get(); void set(bool value); }

    Property Value

    True - command must work as inverse transform; false - command must work as direct transform.
    Default value is false.
    Remarks

    The inverse transform can be used for perspective correction.

    Example

    This C#/VB.NET code shows how to load an image from disk, correct the perspective distortion in document image and save the result to a new image file.

    
    ''' <summary>
    ''' Corrects perspective distortion of document image.
    ''' </summary>
    ''' <param name="sourceFile">Source image file.</param>
    ''' <param name="resultFile">Result image file.</param>
    ''' <param name="documentImagePoints">An array of four points, which define the corner points of document image.
    ''' Points should be set in the following order: 0 - top-left, 1 - top-right,
    ''' 2 - bottom-left, 3 - bottom-right.</param>
    Public Sub ApplyQuadrilateralUnwarp(sourceFile As String, resultFile As String, documentImagePoints As System.Drawing.PointF())
        Using image As New Vintasoft.Imaging.VintasoftImage(sourceFile)
            ' create the perspective correction command
            Dim command As New Vintasoft.Imaging.ImageProcessing.Transforms.QuadrilateralWarpCommand()
    
            ' specify that command must use invert transform (command must work as unwarp command)
            command.IsInverseTransform = True
    
            ' set the corner points of document image
            command.DestinationPoints = documentImagePoints
    
            ' apply perspective correction to a document image
            command.ExecuteInPlace(image)
    
            ' save the result image to a file
            image.Save(resultFile)
        End Using
    End Sub
    
    
    
    /// <summary>
    /// Corrects perspective distortion of document image.
    /// </summary>
    /// <param name="sourceFile">Source image file.</param>
    /// <param name="resultFile">Result image file.</param>
    /// <param name="documentImagePoints">An array of four points, which define the corner points of document image.
    /// Points should be set in the following order: 0 - top-left, 1 - top-right,
    /// 2 - bottom-left, 3 - bottom-right.</param>
    public void ApplyQuadrilateralUnwarp(string sourceFile, string resultFile, System.Drawing.PointF[] documentImagePoints)
    {
        using (Vintasoft.Imaging.VintasoftImage image =
            new Vintasoft.Imaging.VintasoftImage(sourceFile))
        {
            // create the perspective correction command
            Vintasoft.Imaging.ImageProcessing.Transforms.QuadrilateralWarpCommand command =
                new Vintasoft.Imaging.ImageProcessing.Transforms.QuadrilateralWarpCommand();
    
            // specify that command must use invert transform (command must work as unwarp command)
            command.IsInverseTransform = true;
    
            // set the corner points of document image
            command.DestinationPoints = documentImagePoints;
    
            // apply perspective correction to a document image
            command.ExecuteInPlace(image);
    
            // save the result image to a file
            image.Save(resultFile);
        }
    }
    
    

    Requirements

    Target Platforms: .NET9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    See Also