Leadtools.ImageProcessing.Core Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
Angle Property
See Also  Example
Leadtools.ImageProcessing.Core Namespace > DeskewCheckCommand Class : Angle Property



Support for this function will be discontinued in the next major release of LEADTOOLS. Use DeskewCommand instead. Amount by which the command rotates the image.

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property Angle As Integer
Visual Basic (Usage)Copy Code
Dim instance As DeskewCheckCommand
Dim value As Integer
 
value = instance.Angle
C# 
public int Angle {get;}
C++/CLI 
public:
property int Angle {
   int get();
}

Return Value

Amount by which the command rotates the image. The amount of rotation is expressed in hundredths of degrees. For example, 500 means 5 degrees clockwise. Valid values range from -2000 through 2000. The default value is 0.

Example

Run the DeskewCommand on an image and straightens it.

Visual BasicCopy Code
Public Sub AnglePropertyExample()
   RasterCodecs.Startup()
   Dim codecs As New RasterCodecs()
   codecs.ThrowExceptionsOnInvalidImages = True

   Dim leadImage As RasterImage = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Clean.tif")

   ' Prepare the command
   Dim command As DeskewCheckCommand
   command = New DeskewCheckCommand
   'Deskew the image.
   command.Flags = DeskewCheckCommandFlags.DeskewImage Or DeskewCheckCommandFlags.FillExposedArea Or DeskewCheckCommandFlags.UseHighSpeedRotate Or DeskewCheckCommandFlags.UseLineDetectionToDeskewCheck
   command.FillColor = New RasterColor(255, 255, 0)
   command.Run(leadImage)

   MessageBox.Show("The Angle = " & command.Angle.ToString())

   RasterCodecs.Shutdown()
End Sub
C#Copy Code
public void AnglePropertyExample() 

   // Load an image 
   RasterCodecs.Startup(); 
   RasterCodecs codecs = new RasterCodecs(); 
   codecs.ThrowExceptionsOnInvalidImages = true; 
 
   RasterImage image = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Clean.tif"); 
 
   // Prepare the command 
   DeskewCheckCommand command = new DeskewCheckCommand(); 
   //Deskew the image. 
   command.Flags = DeskewCheckCommandFlags.DeskewImage | DeskewCheckCommandFlags.FillExposedArea | DeskewCheckCommandFlags.UseHighSpeedRotate | DeskewCheckCommandFlags.UseLineDetectionToDeskewCheck; 
   command.FillColor = new RasterColor(255, 255, 255); 
 
   command.Run(image); 
 
   MessageBox.Show("The Angle = " + command.Angle.ToString()); 
 
   RasterCodecs.Shutdown(); 
}

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also