/
createColorPicker

createColorPicker

Description

Creates a color picker user control on the user window thats is specified by windowID.

A color picker allows the user to specify a color, using either the predefined colors, or by bringing up the custom color map.

The control is initially placed in the top-left corner of the user window, and must be placed by using the -pos option, or by using the setControlPos command.

The command returns the Control ID of the user control, which should be saved for later operations on the control.

Functional area

User Window

Command syntax

Syntax

createColorPicker parentWindowID[-hidden] [-pos integer array] [-form integer] [-color integer array]

Arguments

NameTypeRequiredComments
windowIdintyesID of User Window to place the control on.

Flags

NameFlag argumentsArgument typeExclusive toComments
hidden0Specifies that the control should be hidden initially. Call showControl to subsequently make it visible. The default is for it to be visible.
color1integer arrayA 3-element int array representing RGB values from 0255, specifying the initial color of the control. The default is blue.
pos1integer arrayA 4-element int array representing a rectangle, which specifies the initial size/position of the control relative to the top left corner of the user window. The element order is Left, Top, Right, and Bottom. The default is a color picker 20 units high by 50 units wide.
form1integerControl ID of the form user control which will dynamically position this control.

Return value

integer

Examples

// Create a Color Picker User Control.
int $windowId;
int $controlId;
int $color[3];
 
// First create a User Window to place the Control on
$windowId = `createWindow "MyWindow"`;
// Specify the initial color of the control, Red
$color [0] = 255; // Red
$color [1] = 0;   // Green
$color [2] = 0;   // Blue
  
// Create the Control on the Window, passing
// in the Window Id of the User Window we 
// just created. Make the Control tri-state and set
// its text
$controlId = `createColorPicker $windowId -color $color`;

Additional information

Related commands

Related content


© Copyright Vicon Motion Systems. All rights reserved.

Vicon trademarks