LabWindows/CVI

ColorPicker_GetAreaFromPoint

int ColorPicker_GetAreaFromPoint (int panel, int control, Point point, int *area, int *index);

Purpose

Converts panel coordinates within a color picker control to the color picker area and index within that area.

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.
point Point Panel coordinates to convert to a color picker area and index.
Output
Name Type Description
area int The area within the color picker control that contains the point you specify. area can be one of the following values:

PICKER_VAL_TRANSPARENT
PICKER_VAL_NONE
PICKER_VAL_FIXED_COLOR
PICKER_VAL_CUSTOM_COLOR
PICKER_VAL_GRADIENT_AREA
PICKER_VAL_SHADE_AREA
index int The index of the color picker area that contains the point you specify. index can be one of the following values:

  • Fixed and custom color cells—index is the zero-based index of the color cell.
  • Transparent item—index is PICKER_VAL_TRANSPARENT.
  • Shade area—index is the pixel offset from the left side of the Shade Area.
  • Gradient area—index corresponds to the pixel located at the point you specified. The pixels in the Gradient Area are arranged in row-major order. The first pixel, 0, is at the upper-left corner of the Gradient Area. The total number of pixels is calculated by the following formula: height of the Gradient Area × width of the Gradient Area.

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