Admin Production ni-theme
Current Publication

ColorPicker_SetCustomColors

LabWindows/CVI

ColorPicker_SetCustomColors

int ColorPicker_SetCustomColors (int panel, int control, int colors[], size_t numColors);

Purpose

Sets the custom colors in the color picker.

Parameters

Input
Name Type Description
panel int The specifier for a particular panel that is currently in memory. You obtain this handle from LoadPanel, NewPanel, or DuplicatePanel.
control int The ID you specified as the canvas parameter in the ColorPicker_Convert function call. This value must be the same as the defined constant, located in the .uir header file, that you assigned to the original canvas control.
colors int [] Array of RGB color values to set. An RGB value is a 4-byte integer with the hexadecimal format 0x00RRGGBB. RR, GG, and BB are the respective red, green, and blue components of the color value.

You also can use the User Interface Library function, MakeColor, to create an RGB value from red, green, and blue color components.
numColors size_t The number of colors to set. If the number of colors you specify is greater than the number of corresponding cells in the color picker control, you receive an error.

Return Value

Name Type Description
status int Return value indicating whether the function was successful. A negative number indicates that an error occurred.

Additional Information

Library: Color Picker Control

Include file: custctrl\color_picker.h

LabWindows/CVI compatibility: LabWindows/CVI 9.0 and later

Example

Refer to userint\custctrl\colorpicker\colorpickerdemo.cws for an example of using the ColorPicker_SetCustomColors function.