GdPicture.NET Reference Guide
PaletteSet Method
Example 





GdPicture14 Namespace > GdPictureImaging Class : PaletteSet Method
GdPicture Image Identifier.
Output parameter. Array of Color Objects. Color entries of the palette.
Sets a new color palette to a GdPicture image.
Syntax
'Declaration
 
Public Function PaletteSet( _
   ByVal ImageID As Integer, _
   ByVal ColorEntries() As Color _
) As GdPictureStatus
public GdPictureStatus PaletteSet( 
   int ImageID,
   Color[] ColorEntries
)
public function PaletteSet( 
    ImageID: Integer;
    ColorEntries: Colorarray of
): GdPictureStatus; 
public function PaletteSet( 
   ImageID : int,
   ColorEntries : Color[]
) : GdPictureStatus;
public: GdPictureStatus PaletteSet( 
   int ImageID,
   Color[]* ColorEntries
) 

Parameters

ImageID
GdPicture Image Identifier.
ColorEntries
Output parameter. Array of Color Objects. Color entries of the palette.

Return Value

A member of the GdPictureStatus enumeration.
Example
Setting the Palette of the Image
Dim oGdPictureImaging As New GdPictureImaging
Dim ImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("input.png")
Dim Palette(15) As Color
Dim i As Integer
For i = 0 To 14
   Palette(i) = Imaging1.ARGB(255, CByte((255) - i), 255, CByte(i))
Next
oGdPictureImaging.PaletteSet(ImageID, Palette)
oGdPictureImaging.SaveAsPNG(ImageID, "output.png")
oGdPictureImaging.ReleaseGdPictureImage(ImageID)
See Also

Reference

GdPictureImaging Class
GdPictureImaging Members