GdPicture.NET Reference Guide
AutoDeskew(Int32,Boolean) Method
Example 





GdPicture14 Namespace > GdPictureImaging Class > AutoDeskew Method : AutoDeskew(Int32,Boolean) Method
GdPicture Image Identifier.
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.
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.
Syntax
'Declaration
 
Public Overloads Function AutoDeskew( _
   ByVal ImageID As Integer, _
   ByVal Optimistic As Boolean _
) As GdPictureStatus
public GdPictureStatus AutoDeskew( 
   int ImageID,
   bool Optimistic
)
public function AutoDeskew( 
    ImageID: Integer;
    Optimistic: Boolean
): GdPictureStatus; 
public function AutoDeskew( 
   ImageID : int,
   Optimistic : boolean
) : GdPictureStatus;
public: GdPictureStatus AutoDeskew( 
   int ImageID,
   bool Optimistic
) 
public:
GdPictureStatus AutoDeskew( 
   int ImageID,
   bool Optimistic
) 

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.
Example
Using AutoDeskew on an image using optimistic mode.
Dim oGdPictureImaging As New GdPictureImaging
Dim ImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("input.png")
If imageId <> 0 Then
   oGdPictureImaging.AutoDeskew(ImageID, True)
   oGdPictureImaging.SaveAsPNG(ImageID, "output.png")
   oGdPictureImaging.ReleaseGdPictureImage(ImageID)
Else
   MessageBox.Show("Error: " + oGdPictureImaging.GetStat().ToString())
End If
See Also

Reference

GdPictureImaging Class
GdPictureImaging Members
Overload List
GetSkewAngle(Int32) Method