ColorValueToInteger Method

NI Vision for Visual Basic

ColorValueToInteger Method

Syntax

CWIMAQVision.ColorValueToInteger Plane1, Plane2, Plane3, ColorFormat, Values

Return Type

Long

On success, this method returns 0. On failure, this method returns a negative number.

Purpose

Converts color values to integers.

Parameters

Plane1 As Variant

The red or hue values. This parameter can be a scalar value or an array.

Plane2 As Variant

The green or saturation values. This parameter can be a scalar value or an array.

Plane3 As Variant

The blue, light, value, or intensity values. This parameter can be a scalar value or an array.

ColorFormat As CWIMAQColorFormats

The source color space used for the operation.

Values As Variant

On return, the converted integer values.

Example

Dim values

'Convert HSL colors (0,0,255), (128,128,128), and (255,0,255)
'into integers
CWIMAQVision1.ColorValueToInteger Array(0, 128, 255), _
                                  Array(0, 128, 0), _
                                  Array(255, 128, 255), _
                                  cwimaqColorFormatHSL, _
                                  values