ClearImage COM API
MeasureHorzHistogram Method
CiTools Object : MeasureHorzHistogram Method
Description
Measure horizontal histogram
Syntax
Visual Basic
Public Function MeasureHorzHistogram() As Variant
Return Type
An array of integers with the number of pixels in each column.
Remarks
Method requires bi-tonal image (object.Image.BitsPerPixel = 1).
Example
Measure Vertical and Horizontal Histograms
Sub MeasureHistogram(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 Hist, i, start
  Hist = Tools.MeasureHorzHistogram
  For i = LBound(Hist) To UBound(Hist)
    start = 0:  If (Tools.Image.IsZone) Then start = Tools.Image.Zone.Top
    Debug.Print "Row=" & start + i & " Pixels=" & Hist(i) & vbCrLf
  Next
  
  Hist = Tools.MeasureVertHistogram
  For i = LBound(Hist) To UBound(Hist)
    start = 0:  If (Tools.Image.IsZone) Then start = Tools.Image.Zone.Left
    Debug.Print "Col=" & start + i & " Pixels=" & Hist(i) & vbCrLf
  Next
End Sub
See Also

CiTools Object  | CiTools Members  | MeasureVertHistogram  | MeasureHorzHistogram