// Calculate image histogram.
// Channel range to calculate.
ImGearChannelRange igChannelRange = new ImGearChannelRange(0, igRasterPage.DIB.ChannelCount);
// Integer array to hold histogram data
int[,] histogramData = new int[igRasterPage.DIB.ChannelCount,(int)Math.Pow(2,igRasterPage.DIB.BitsPerChannel)];
//Tabulate the histogram data.
ImGearRasterProcessing.TabulateHistogram(igRasterPage, histogramData, igChannelRange);
// Show a piece of the data.
MessageBox.Show(histogramData[0,0] + " pixels had the value 0 for the first channel.", "Histogram Data");
' Calculate image histogram.
' Channel range to calculate.
Dim igChannelRange As New ImGearChannelRange(0, igRasterPage.DIB.ChannelCount)
' Integer array to hold histogram data
Dim numberOfValues As Integer
numberOfValues = CInt(Math.Pow(2, igRasterPage.DIB.BitsPerChannel))
Dim histogramData As Integer(,) = New Integer(igRasterPage.DIB.ChannelCount - 1, numberOfValues - 1) {}
'Tabulate the histogram data.
ImGearRasterProcessing.TabulateHistogram(igRasterPage, histogramData, igChannelRange)
' Show a piece of the data.
MessageBox.Show(histogramData(0, 0).ToString() + " pixels had the value 0 for the first channel.", "Histogram Data")