ClearImage COM API
MeasureRotation Method
CiTools Object : MeasureRotation Method
Description
Measure image rotation
Syntax
Visual Basic
Public Function MeasureRotation() As EPageRotation
Return Type

If the image contains enough capital letters of the Latin alphabet, this method returns ciRotNoneciRotUpsideDownciRotLeft, or ciRotRight.
If the image does not contain a sufficient number of good quality letters, then graphical features like lines are used.
If the most lines are horizontal, this method returns ciRotPortrait. If the most lines are vertical, this method returns ciRotLeftOrRight.
If neither sufficient letters or lines are present, this method returns ciRotUnknow.

 

Remarks

rConfidence property contains confidence level in percents.

Example
Measure Skew and Rotation
Sub MeasureSkewRotation(imageFile As String)
      ' Open image file
  Dim Ci As New CiServer
  Dim Tools As CiTools: Set Tools = Ci.CreateTools
  Tools.Image.Open imageFile
      ' Do processing
  Dim skew As Double, rot As EPageRotation
  skew = Tools.MeasureSkew
  Debug.Print "Skew=" & skew & "   Confidence=" & Tools.rConfidence & "%" & vbCrLf
  rot = Tools.MeasureRotation
  Debug.Print "Rotation=" & _
     Switch(rot = ciRotUnknown, "Unknown", _
              rot = ciRotNone, "None", _
              rot = ciRotLeft, "TurnedLeft", _
              rot = ciRotRight, "TurnedRight", _
              rot = ciRotUpsideDown, "UpsideDown", _
              rot = ciRotLeftOrRight, "TurnedLeftOrRight", _
              rot = ciRotPortrait, "Portrait") & _
      "   Confidence=" & Tools.rConfidence & "%"
End Sub
See Also

CiTools Object  | CiTools Members  | MessureSkew  | MeasureRotation  | rConfidence