How to automatically deskew an image?
For Dynamic .NET TWAIN v6.x and lower versions only, for V7.x+ please refer to http://developer.dynamsoft.com/dnt/kb
Generally, there are two ways to automatically deskew an image with Dynamic .NET TWAIN.1. The first option is to use Dynamic .NET TWAIN's built-in methods.
Below are the basic steps:
- Calculate the skew angle by using GetSkewAngle Method,
Angle = DynamicDotNetTWAIN.GetSkewAngle(DynamicDotNetTWAIN.CurrentImageIndexInBuffer);
- Use Rotate method to de-skew the image,
If you want to do de-skew to each scanned image, you can call the above code in OnPostTransfer Event. 2. The second option is to 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,
If you need any assistance or have any problem, please feel free to contact us.