Admin Production ni-theme
Current Publication

GetNumericColorRamp

LabWindows/CVI

GetNumericColorRamp

int GetNumericColorRamp (int panelHandle, int controlID, ColorMapEntry colorMapArray[], int *hiColor, int *interpolateColors);

Purpose

Obtains the values of a numeric slide control color ramp.

Supported Controls

You can use GetNumericColorRamp 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.
Output
Name Type Description
colorMapArray ColorMapEntry[] Returns the array of ColorMapEntry structures.

colorMapArray can contain up to 255 ColorMapEntry structures that LabWindows/CVI defines as follows:

typedef struct
{

union
{

char valChar;
int valInt;
__int64 valInt64;
short valShort;
float valFloat;
double valDouble;
unsigned char valUChar;
unsigned long valULong;
unsigned __int64 valUInt64;
unsigned short valUShort;

} dataValue;
int color;

} ColorMapEntry;



Note Note  You must allocate and free the necessary memory for this parameter.
hiColor int Returns the RGB value that corresponds to the color displayed for numeric slide values that are higher than the highest data value in colorMapArray.
interpolateColors int Returns whether colors on the color ramp transition smoothly or abruptly between values specified in colorMapArray.

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 GetNumericColorRamp function.