CxSubtract Method

NI Vision for Visual Basic

CxSubtract Method

Syntax

CWIMAQVision.CxSubtract SourceImage, DestImage, ImageOrReal [, Imaginary]

Return Type

Long

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

Purpose

Subtracts an image or a constant from a complex image.

Remarks

SourceImage and DestImage must be Complex images.

If ImageOrReal is an image, it must be a U8, I16, SGL, or Complex image.

Parameters

SourceImage As CWIMAQImage

The first input image.

DestImage As CWIMAQImage

The resulting image.

ImageOrReal As Variant

Either the second input image or the real part of the constant.

Imaginary As Variant

[Optional] The imaginary part of the constant.

Example

' Subtract a constant 10-20i from the image in Viewer1
Dim i As New CWIMAQImage
i.Type = cwimaqImageTypeComplex

CWIMAQVision1.CxSubtract CWIMAQViewer1.Image, i, 10, -20

' Subtract the image in i from Viewer1.  Store the result in i
CWIMAQVision1.CxSubtract CWIMAQViewer1.Image, i, i