AutoDeskew(Int32,Boolean) Method
Tries to deskew a GdPicture image.
Deskewing an image can help a lot to do OCR, OMR, barcode detection or just improve the readability
of an image.
'Declaration
Public Overloads Function AutoDeskew( _
ByVal As Integer, _
ByVal As Boolean _
) As GdPictureStatus
Parameters
- ImageID
- GdPicture image identifier.
- Optimistic
- Determines if the engine must be optimistic in the skew detection. For example, set true when you know the image has a skew and false otherwise. Value used by other overloads is False.
Return Value
A member of the GdPictureStatus enumeration.
Deskewing a tiff image.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
int imageID = gdpictureImaging.CreateGdPictureImageFromFile("skewed.tif");
gdpictureImaging.AutoDeskew(imageID, true);
// Let's encode the new tiff with the same mode used by the input image.
TiffCompression tiffCompression = gdpictureImaging.GetTiffCompression(imageID);
gdpictureImaging.SaveAsTIFF(imageID, "deskewed.tif", tiffCompression);
gdpictureImaging.ReleaseGdPictureImage(imageID);
}