ClearImage COM API
AutoCrop Method
CiRepair Object : AutoCrop Method
New left margin in pixels
New top margin in pixels
New right margin in pixels
New bottom margin in pixels
Description
Set image margins
Syntax
Visual Basic
Public Sub AutoCrop( _
   ByVal NewLeftMargin As Long, _
   ByVal NewTopMargin As Long, _
   ByVal NewRightMargin As Long, _
   ByVal NewBottomMargin As Long _
) 
Parameters
NewLeftMargin
New left margin in pixels
NewTopMargin
New top margin in pixels
NewRightMargin
New right margin in pixels
NewBottomMargin
New bottom margin in pixels
Remarks

The margin is a distance from the image edge to the image pixel nearest to that edge. 
This method changes the size of the image.

Example
Sub RepairMethods(imageFile As String, imageFileOut As String)
    ' Create objects and open input images
  Dim Ci As New CiServer
  Dim Repair As CiRepair: Set Repair = Ci.CreateRepair
  Repair.Image.Open imageFile
    ' Do Processing
  Repair.AutoDeskew                  ' Use AutoDeskew before AutoRotate
  Repair.AutoRotate
  '  Repair.AutoCrop 10, 10, 10, 10  ' Do not use AutoCrop with AutoRegister or BorderExtract
  '  Repair.AutoRegister 100, 100    ' Do not use AutoRegister with AutoCrop or BorderExtract
  Repair.AdvancedBinarize 0, 0, 0
  Repair.BorderExtract ciBexBorderDeskewCrop, ciBeaCleaner
  Repair.RemovePunchHoles
  Repair.SmoothCharacters ciSmoothDarkenEdges
  Repair.CleanNoise 3                ' Use CleanNoiseExt to remove white noise
  '  Repair.CleanNoiseExt (ciCnxBlackNoise + ciCnxWhiteNoise), 3, 3, 10, 0
  Repair.pLineCurvature = ciCurvLow
  Repair.pMaxLineAngle = 5
  Repair.pMaxLineGap = 5
  Repair.pMinLineLength = 200
  Repair.DeleteLines ciLineVertAndHorz, ciTrue
  Repair.Image.SaveAs imageFileOut, ciEXT
End Sub
See Also

CiRepair Object  | CiRepair Members  | AutoCrop  | AutoRegister