This method retrieves the palette information for a raster image
[Visual Basic]   [ Boolean = ]imagekitcontrolname.GetPaletteVariant(Red As Variant, Green As Variant, Blue As Variant, ImageHandle As Long)
[VB.NET]   [ Boolean = ]imagekitcontrolname.GetPaletteVariant(ByRef Red As Object, ByRef Green As Object, ByRef Blue As Object, ImageHandle As Object)
[C#.NET]   [ bool = ]imagekitcontrolname.GetPaletteVariant(ref object Red, ref object Green, ref object Blue, object ImageHandle)

Parameters

Name Explanation
Red Array of the retrieved red palette information
Green Array of the retrieved green palette information
Blue Array of the retrieved blue palette information
ImageHandle The image handle of the raster image.

* In Visual Basic or VB.NET, pass the arguments as Red
In C#.NET, pass the arguements as ref Red

Return Value

Returns True (nonzero) if successful, otherwise returns False (0).

Explanation

When the ImageHandle parameter contains a valid image handle
The image data that the ImageHandle parameter refers to will be processed.


When the ImageHandle parameter contains is omitted
The image data determined by the LayerNo property will be processed. If the LayerNo property is -1 (the base image) then the image data referred to by the ImageHandle property will be processed. If the value of the LayerNo property is between 0 and 99 then the image data referred to by the Layer(LayerNo).ImageHandle property will be processed.


To find out how many items are in the various RGB arrays retrieved from the palette information, please refer to the PalCount property. The PalCount property value is refreshed when ever an image handle is set into the ImageHandle property of the Layer(LayerNo).ImageHandle property. Use the GetImageType method to retrieve the PalCount property value.

For programs that do not require variant types, please refer to the GetPalette method.

Examples:

In Visual Basic:

    Dim r

    Dim g

    Dim b


    ImageKit1.LayerNo = -1

    If ImageKit1.PalCount < 1 Then Exit Sub

    ImageKit1.GetPaletteVariant r, g, b

    'using the rgb values....

    ImageKit1.SetPaletteVariant r, g, b



In VB.NET:

    ImageKit1.LayerNo = -1

    If ImageKit1.PalCount < 1 Then Exit Sub

    Dim r as Object = Nothing

    Dim g as Object = Nothing

    Dim b as Object = Nothing

    ImageKit1.GetPaletteVariant(r, g, b)

    'using the rgb values....

    ImageKit1.SetPaletteVariant(r, g, b)



In C#.NET:

    ImageKit1.LayerNo = -1;

    if(ImageKit1.PalCount < 1) return;

    object r = null;

    object g = null;

    object b = null;

    ImageKit1.GetPaletteVariant(ref r, ref g, ref b);

    //using the rgb values....

    ImageKit1.SetPaletteVariant(ref r, ref g, ref b);

 

The ImageKit9 ActiveX is a product created by Newtone Corporation