SetNumericColorRamp
int SetNumericColorRamp (int panelHandle, int controlID, ColorMapEntry colorMapArray[], int hiColor, int numberOfColors, int interpolateColors);
Purpose
Adds a color ramp to a numeric slide control.
The color ramp consists of colors that correspond to the data values along the scale. If you set interpolateColors to 1, LabWindows/CVI adds smooth color transitions between the data values specified.
Supported Controls
You can use SetNumericColorRamp with numeric slide controls.
Parameters
Input | ||
Name | Type | Description |
panelHandle | int | Specifier for a particular panel that is currently in memory. You can obtain this handle from functions such as LoadPanel and NewPanel. |
controlID | int | The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by functions such as NewCtrl and DuplicateCtrl. |
colorMapArray | ColorMapEntry[] | Array of ColorMapEntry structures. colorMapArray defines how to translate values on the numeric slide into color values. If a data value exactly matches a data value in one of the ColorMapEntry structures, the function converts it to the corresponding color. Otherwise, the following rules apply:
colorMapArray can contain up to 255 ColorMapEntry structures that LabWindows/CVI defines as follows: typedef struct union char valChar; } dataValue; } ColorMapEntry; You do not need to sort the order of the colorMapArray. |
hiColor | int | RGB value that corresponds to the color for numeric scale values that are higher than the highest data value in colorMapArray. |
numberOfColors | int | Number of entries in colorMapArray. numberOfColors must be less than or equal to 255. If interpolateColors is nonzero, numberOfColors must be greater than or equal to two. |
interpolateColors | int | Indicates how to assign colors to the numeric scale values that do not exactly match the data values in the colorMapArray. If you set interpolateColors to zero, the colors shift abruptly along the scale. If you set interpolateColors to nonzero, the colors blend together smoothly between specified data values. In all cases, the following rules apply to extreme values:
|
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: User Interface Library
Include file: userint.h
LabWindows/CVI compatibility: LabWindows/CVI 8.5 and later
Example
Refer to userint\ColorRamps.cws for an example of using the SetNumericColorRamp function.