Web Demos

BARCODE READER SDK DEMO

Explore the flexibe barcode reading settings to optimize for your specific usage scenario.

WEB TWAIN SDK DEMO

Try the most popular web scanner features: scan images, import local images and PDF files, edit, save to local, upload to database, and etc.

BARCODE READER JAVASCRIPT DEMO

Transform any camera-equipped devices into real-time, browser-based barcode and QR code scanners.

MRZ SCANNER WEB DEMO

Detects the machine-readable zone of a passport, scans the text, and parses into human-readable data.

APP STORE DEMOS

BARCODE READER SDK FOR IOS

BARCODE READER SDK FOR ANDROID

VIEW MORE DEMOS >
Dev Center
Table of contents

How to automatically deskew an image

Generally, there are two ways to automatically deskew an image with Dynamic .NET TWAIN.

  • Option 1: Use Dynamic .NET TWAIN’s built-in methods. Below are the basic steps:
    • Calculate the skew angle by using GetSkewAngle Method,
        double Angle;
        Angle = m_ImageCore.ImageProcesser.GetSkewAngle(m_ImageCore.ImageBuffer.CurrentImageIndexInBuffer);
      
    • Use Rotate method to de-skew the image,
        m_ImageCore.ImageProcesser.Rotate(m_ImageCore.ImageBuffer.CurrentImageIndexInBuffer, -Angle, true, Dynamsoft.Core.Enums.EnumInterpolationMethod.BestQuality);
      

      If you want to do de-skew to each scanned image, you can call the above code in OnPostTransfer Event.

Option 2: Use custom capability of the scanner, which requires the support of the scanner itself.

You can use CapSet functionality and the code is as follows,
```c#
m_TwainManager.Capability = (Dynamsoft.TWAIN.Enums.TWCapability)4433; //AutoDeskew
m_TwainManager.CapType = Dynamsoft.TWAIN.Enums.TWCapType.TWON_ONEVALUE;
m_TwainManager.CapValue = 0;
bool bRet = m_TwainManager.CapSet();
```

If you need any assistance or have any problem, please feel free to contact support@dynamsoft.com.

This page is compatible for:

Version 7.5

Is this page helpful?

YesYes NoNo

In this article:

latest version

    • Latest Version
    © 2003–2023 Dynamsoft. All rights reserved.
    Privacy Statement / Site Map / Home / Purchase / Support