GdPicture.NET Reference Guide
PaletteGet Method
Example 





GdPicture14 Namespace > GdPictureImaging Class : PaletteGet Method
GdPicture Image Identifier.
Output parameter. Array of Color Objects. Color array which will contain the complete color palette.
Output parameter. Contains the number of colors contained in the ColorEntries() array.
Gets into a 1D array the complete color palette of a GdPicture image.
Syntax
'Declaration
 
Public Function PaletteGet( _
   ByVal ImageID As Integer, _
   ByRef ColorEntries As Color(), _
   ByRef EntriesCount As Integer _
) As GdPictureStatus
public function PaletteGet( 
    ImageID: Integer;
   var  ColorEntries: array of Color;
   var  EntriesCount: Integer
): GdPictureStatus; 
public function PaletteGet( 
   ImageID : int,
   ColorEntries : Color[],
   EntriesCount : int
) : GdPictureStatus;
public: GdPictureStatus PaletteGet( 
   int ImageID,
   ref Color[] ColorEntries,
   ref int EntriesCount
) 

Parameters

ImageID
GdPicture Image Identifier.
ColorEntries
Output parameter. Array of Color Objects. Color array which will contain the complete color palette.
EntriesCount
Output parameter. Contains the number of colors contained in the ColorEntries() array.

Return Value

A member of the GdPictureStatus enumeration.
Example
Retrieving the image's palette
Dim oGdPictureImaging As New GdPictureImaging
Dim ColorEntries() As Color
Dim EntriesCount As Integer
Dim ImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("input.png")
oGdPictureImaging.PaletteGet(ImageID, ColorEntries, EntriesCount)
'you can do your processing on the palette here
oGdPictureImaging.ReleaseGdPictureImage(ImageID)
See Also

Reference

GdPictureImaging Class
GdPictureImaging Members