Initializes a new
DeskewExtendedCommand class object with explicit parameters.
Syntax
Parameters
- angleResolution
- Deskew angle precision. The valid range is from 1 to uAngleRange (maximum deskew angle). The real value is divided by 10.
- angleRange
- Maximum angle of deskew, in hundredths of degrees. Possible values range from -4500 to 4500. This value is divided internally by 100.
- fillColor
- RasterColor used to fill the background following rotation. This value is used only if DeskewExtendedCommandFlags.FillExposedArea is set in flags.
- flags
- Flags that indicate whether to deskew the image, which background color to use, whether to
deskew the image if the skew angle is very small, which type of interpolation is to be used, whether the image
is mostly text or text and pictures, and whether to use normal or fast rotation.
Example
Run the DeskewExtendedCommand on an image and applies the Deskew Extended filter.
Visual Basic | Copy Code |
---|
Public Sub DeskewExtendedConstructorExample()
RasterCodecs.Startup()
Dim codecs As New RasterCodecs()
codecs.ThrowExceptionsOnInvalidImages = True
Dim leadImage As RasterImage = codecs.Load(LeadtoolsExamples.Common.ImagesPath.Path + "Clean.tif")
Dim fillColor As New RasterColor(0, 0, 0)
Dim command As DeskewExtendedCommand = New DeskewExtendedCommand(2, 1000, fillColor, DeskewExtendedCommandFlags.DeskewImage Or DeskewExtendedCommandFlags.DoNotFillExposedArea Or DeskewExtendedCommandFlags.RotateLinear Or DeskewExtendedCommandFlags.DocumentImage)
command.Run(leadImage)
RasterCodecs.Shutdown()
End Sub |
C# | Copy Code |
---|
public void DeskewExtendedConstructorExample() { // 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 RasterColor fillColor = new RasterColor(0, 0, 0); DeskewExtendedCommand command = new DeskewExtendedCommand(2, 1000, fillColor, DeskewExtendedCommandFlags.DeskewImage | DeskewExtendedCommandFlags.DoNotFillExposedArea | DeskewExtendedCommandFlags.RotateLinear | DeskewExtendedCommandFlags.DocumentImage); command.Run(image); 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