This method sets the palette information for a raster image

[C++Builder]   [ bool = ]imagekitcontrolname->SetPaletteToImage(const short * Red, const int Red_Size, const short * Green, const int Green_Size, const short * Blue, const int Blue_Size, NativeUInt ImageHandle)
[C++Builder]   [ bool = ]imagekitcontrolname->SetPaletteToImage(const short * Red, const int Red_Size, const short * Green, const int Green_Size, const short * Blue, const int Blue_Size)
[Delphi]   [ Boolean = ]imagekitcontrolname.SetPaletteToImage(const Red, Green, Blue: array of Smallint; ImageHandle: THandle)
[Delphi]   [ Boolean = ]imagekitcontrolname.SetPaletteToImage(const Red, Green, Blue: array of Smallint)

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 C++Builder, the -1 element is passed to Red_Size, Green_Size, Blue_Size

Return Value

Returns True if successful, otherwise returns False.

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.

Differences from ImageKit7/8/9/10 ActiveX

The method name has been changed from SetPalette.

 

The ImageKit10 VCL is a product created by Newtone Corporation