And Method

NI Vision for Visual Basic

And Method

Syntax

CWIMAQVision.And SourceImage, Operand, DestImage [, Not = False]

Return Type

Long

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

Purpose

Computes a bitwise AND or a bitwise NAND between two images or an image and a constant.

Remarks

Use this method with image types U8, I16, RGB32, and HSL32.

SourceImage and DestImage must be the same type of image. If Operand is an image, it must be the same type of image as SourceImage.

This method is optimized for MMX.

Parameters

SourceImage As CWIMAQImage

The first input image.

Operand As Variant

Either the second input image or a constant.

DestImage As CWIMAQImage

The resulting image. It can be one of the source images.

Not As Variant

[Optional] Set this parameter to True to perform a NAND instead of an AND.

This parameter has a default value of False.

Example

Dim i As New CWIMAQImage

' And operation between a constant and an image in Viewer1.
' Store the result in i
CWIMAQVision1.And CWIMAQViewer1.Image, 1, i

' And image i with the image in Viewer1.
' Do the operation inplace (store the result in i)
CWIMAQVision1.And CWIMAQViewer1.Image, i, i