GetHistogram example for Visual Basic
Dim RasterProc As New LEADRasterProcess
Dim nIndex As Integer
Dim nBrightest As Integer
Dim nDarkest As Integer
RasterProc.HistogramTableSize = 256
RasterProc.GetHistogram LEADRasterView1.Raster, CHANNEL_RED Or _
HIST_LOWHIGH_BITS
nDarkest = 0
nBrightest = 0
For nIndex = 0 To 255
If (RasterProc.HistogramTable(nIndex) <> 0) Then
nBrightest = nIndex
If (nDarkest = 0) Then
nDarkest = nIndex
End If
End If
Next nIndex
MsgBox "Darkest red =" + Str(nDarkest) + " Brightest red =" + Str(nBrightest)