GdPicture.NET Reference Guide
HistogramGetGreen Method (GdPictureImaging)
Example 





GdPicture14 Namespace > GdPictureImaging Class : HistogramGetGreen Method
GdPicture Image Identifier.
Output parameter. Array of 256 entries containing the green channel histogram data.
Computes the green channel histogram of a GdPicture image.
Syntax
'Declaration
 
Public Function HistogramGetGreen( _
   ByVal ImageID As Integer, _
   ByRef Data As Integer() _
) As GdPictureStatus
public GdPictureStatus HistogramGetGreen( 
   int ImageID,
   ref int[] Data
)
public function HistogramGetGreen( 
    ImageID: Integer;
   var  Data: array of Integer
): GdPictureStatus; 
public function HistogramGetGreen( 
   ImageID : int,
   Data : int[]
) : GdPictureStatus;
public: GdPictureStatus HistogramGetGreen( 
   int ImageID,
   ref int[] Data
) 
public:
GdPictureStatus HistogramGetGreen( 
   int ImageID,
   array<int>% Data
) 

Parameters

ImageID
GdPicture Image Identifier.
Data
Output parameter. Array of 256 entries containing the green channel histogram data.

Return Value

A member of the GdPictureStatus enumeration.
Example
Finding out the most used green channel value in an image.
Dim oGdPictureImaging As New GdPictureImaging
Dim ImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("input.png")
If imageId <> 0 Then
   Dim arHistoG(255) As Integer
   oGdPictureImaging.HistogramGetGreen(ImageID, arHistoG)
   Dim Max As Integer = -1
   For i As Integer = 0 To 255
      If Max < arHistoG(i) Then
         Max = arHistoG(i)
      End If
   Next
   MessageBox.Show("The most frequent green value in the image is: " + Max.ToString())
   oGdPictureImaging.ReleaseGdPictureImage(ImageID)
Else
   MessageBox.Show("Error: " + oGdPictureImaging.GetStat().ToString())
End If
See Also

Reference

GdPictureImaging Class
GdPictureImaging Members