This method sets the palette information for a raster  image
[Visual Basic]   [ Boolean = ]imagekitcontrolname.SetPalette(Red As Integer, Green As Integer, Blue As Integer, ImageHandle As LONG_PTR)
[Visual C++]     [ BOOL = ]imagekitcontrolname.SetPalette(short *Red, short *Green, short *Blue, LONG_PTR ImageHandle)
[VB.NET]   [ Boolean = ]imagekitcontrolname.SetPalette(ByRef Red As Short, ByRef Green As Short, ByRef Blue As Short, ImageHandle As Integer(x86) or Long(x64))
[C#.NET]   [ bool = ]imagekitcontrolname.SetPalette(ref short Red, ref short Green, ref short Blue, int(x86) or long(x64) ImageHandle)

* (x86) refers to the 32bit version, (x64) refers to the 64bit version.

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

* (1)In Visual Basic pass the argument as Red(0)
   (2)In Visual C++ pass the pointer to the top of the array
   (3)In VB.NET pass the argument as Red(0)
   (4)In C#.NET pass the argument as Red[0]

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 0
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.

The number of colors that can be set must be the same as the number of colors of the image.

To find out how many items are in the various RGB arrays, 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 in ASP or other scripting languages that use variant types, or for VB.NET and C# in x64 builds, please refer to the SetPaletteVariant method.

 

The ImageKit10 ActiveX is a product created by Newtone Corporation