GdPicture.NET.14
GdPicture14 Namespace / GdPictureImaging Class / AutoDeskew Method / AutoDeskew(Int32) Method
GdPicture image identifier.
Example





In This Topic
AutoDeskew(Int32) Method
In This Topic
Tries to deskew a GdPicture image to about ± 15 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 _
) As GdPictureStatus
public GdPictureStatus AutoDeskew( 
   int ImageID
)
public function AutoDeskew( 
    ImageID: Integer
): GdPictureStatus; 
public function AutoDeskew( 
   ImageID : int
) : GdPictureStatus;
public: GdPictureStatus AutoDeskew( 
   int ImageID
) 
public:
GdPictureStatus AutoDeskew( 
   int ImageID
) 

Parameters

ImageID
GdPicture image identifier.

Return Value

A member of the GdPictureStatus enumeration.
Remarks
This method is used in the "Image Processing" Demo.
Example
Deskewing a tiff image.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    int imageID = gdpictureImaging.CreateGdPictureImageFromFile("skewed.tif");
 
    gdpictureImaging.AutoDeskew(imageID);
 
    // 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