GdPicture.NET Reference Guide
HistogramGetAlpha Method (GdPictureImaging)
Example 





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

Parameters

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

Return Value

A member of the GdPictureStatus enumeration.
Example
Finding out the most used alpha channel value in an image.
Dim oGdPictureImaging As New GdPictureImaging
Dim ImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("input.png")
If imageId <> 0 Then
   Dim arHistoA(255) As Integer
   oGdPictureImaging.HistogramGetAlpha(ImageID, arHistoA)
   Dim Max As Integer = -1
   For i As Integer = 0 To 255
      If Max < arHistoA(i) Then
         Max = arHistoA(i)
      End If
   Next
   MessageBox.Show("The most frequent alpha 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