GdPicture image identifier.
Maximum angle of research. IE: set 10 to perform a skew research about ±10 degrees. A value lower than 15 is suggested. Value used by other overloads is 15.
Example





In This Topic
GdPicture14 Namespace / GdPictureImaging Class / AutoDeskew Method / AutoDeskew(Int32,Single) Method

AutoDeskew(Int32,Single) Method

In This Topic
Tries to deskew a GdPicture image to about ± specified degrees. Deskewing an image can help a lot to do OCR, OMR, barcode detection or just improve the readability of an image.
Syntax
'Declaration
 
Public Overloads Function AutoDeskew( _
   ByVal ImageID As Integer, _
   ByVal MaxAngleOfResearch As Single _
) As GdPictureStatus
public GdPictureStatus AutoDeskew( 
   int ImageID,
   float MaxAngleOfResearch
)
public function AutoDeskew( 
    ImageID: Integer;
    MaxAngleOfResearch: Single
): GdPictureStatus; 
public function AutoDeskew( 
   ImageID : int,
   MaxAngleOfResearch : float
) : GdPictureStatus;
public: GdPictureStatus AutoDeskew( 
   int ImageID,
   float MaxAngleOfResearch
) 
public:
GdPictureStatus AutoDeskew( 
   int ImageID,
   float MaxAngleOfResearch
) 

Parameters

ImageID
GdPicture image identifier.
MaxAngleOfResearch
Maximum angle of research. IE: set 10 to perform a skew research about ±10 degrees. A value lower than 15 is suggested. Value used by other overloads is 15.

Return Value

A member of the GdPictureStatus enumeration.
Remarks
This method is useful when you suspect some images to be skewed, but you do not want completely rotated images to be deskewed. It offers control and limitation over the deskew operation.

This method requires the Image Documents component to run.

Example
Deskewing a tiff image.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    int imageID = gdpictureImaging.CreateGdPictureImageFromFile("skewed.tif");
 
    gdpictureImaging.AutoDeskew(imageID, 10);
 
    // 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);
}
See Also