ColorValueConversion Method

NI Vision for Visual Basic

ColorValueConversion Method

Syntax

CWIMAQVision.ColorValueConversion SourceColorFormat, SourcePlane1, SourcePlane2, SourcePlane3, DestColorFormat, DestPlane1, DestPlane2, DestPlane3

Return Type

Long

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

Purpose

Obsolete—Use ColorValueConversion2 instead. Maps the value of a color in one color mode into the value of the same color in another color mode.

Parameters

SourceColorFormat As CWIMAQColorFormats

The source color space used for the operation.

SourcePlane1 As Variant

The red or hue value of the source pixel.

SourcePlane2 As Variant

The green or saturation value of the source pixel.

SourcePlane3 As Variant

The blue, light, value, or intensity value of the pixel.

DestColorFormat As CWIMAQColorFormats

The destination color space used for the operation.

DestPlane1 As Variant

On return, the red or hue value of the destination pixel.

DestPlane2 As Variant

On return, the green or saturation value of the destination pixel.

DestPlane3 As Variant

On return, the blue, light, value, or intensity value of the destination pixel.

Example

Dim hue
Dim saturation
Dim luminance

'Find the HSL values equivalent to RGB color (128, 128, 128)
CWIMAQVision1.ColorValueConversion cwimaqColorFormatRGB, _
                                   128, 128, 128, _
                                   cwimaqColorFormatHSL, _
                                   hue, saturation, luminance

See Also

ColorValueConversion2