Multiply Method

NI Vision for Visual Basic

Multiply Method

Syntax

CWIMAQVision.Multiply SourceImage, Operand, DestImage

Return Type

Long

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

Purpose

Multiplies an image by an image, or multiplies an image by a constant.

Remarks

Use this method with U8, I16, SGL, and RGB32 images.

If Operand is an image, its type depends on the type of SourceImage, as follows:

  • If SourceImage is U8, Operand must be U8, I16, SGL, or RGB32.

  • If SourceImage is I16 or SGL, Operand must be U8, I16, or SGL.

  • If SourceImage is RGB32, Operand must be RGB32 or U8.

If Operand is an image and Operand is of a type that contains more bits per pixel than SourceImage, Operand and DestImage must be the same type of image. Otherwise, SourceImage and DestImage must be the same type of image.

This method is optimized for MMX.

Parameters

SourceImage As CWIMAQImage

The first input image.

Operand As Variant

The second input image or a constant. Constants are rounded down if SourceImage is encoded as an integer.

DestImage As CWIMAQImage

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

Example

Dim i As New CWIMAQImage

' Multiply the image in Viewer1 by a constant
' Store the result in i
CWIMAQVision1.Multiply CWIMAQViewer1.Image, 50, i

' Multiply the image in Viewer1 by the image in i
' Do the multiplication in-place (store the result in i)
CWIMAQVision1.Multiply CWIMAQViewer1.Image, i, i