Expand2 Method

NI Vision for Visual Basic

Expand2 Method

Syntax

CWIMAQVision.Expand2 SourceImage, DestImage [, Rectangle] [, xDuplication = 1] [, yDuplication = 1]

Return Type

Long

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

Purpose

Expands (duplicates) an image or part of an image by adjusting the horizontal and vertical resolution.

Remarks

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

Parameters

SourceImage As CWIMAQImage

The image to expand.

DestImage As CWIMAQImage

The resulting image.

Rectangle As Variant

[Optional] A CWIMAQRectangle object defining the portion of the image that the method expands. The operation applies to the entire image if this parameter is not supplied.

xDuplication As Variant

[Optional] The number of pixel duplications per column. The method copies the pixel columns to the destination image without duplication if you use the default value.

This parameter has a default value of 1.

yDuplication As Variant

[Optional] The number of pixel duplications per row. The method copies the pixel rows to the destination image without duplication if you use the default value.

This parameter has a default value of 1.

Example

Dim i As New CWIMAQImage
Dim r As New CWIMAQRectangle

' Expand a 50 x 50 rectangular portion of the image in Viewer1
' starting at (20,30) by a factor of 2.
' Store the result in i.
r.Initialize 20, 30, 50, 50
CWIMAQVision1.Expand2 CWIMAQViewer1.Image, i, r, 2, 2

See Also

Extract2

CWIMAQRectangle