ImageToImage Method

NI Vision for Visual Basic

ImageToImage Method

Syntax

CWIMAQVision.ImageToImage SourceImage, DestImage, Left, Top

Return Type

Long

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

Purpose

Copies a small image into a larger image, which is useful for making thumbnail sketches from multiple miniature images.

Remarks

This function operates on all image types.

The source and destination images must be of the same type.

Parameters

SourceImage As CWIMAQImage

The source image to copy.

DestImage As CWIMAQImage

The destination image into which the method copies the source image.

Left As Long

The x-coordinate in the destination image where the method copies the source.

Top As Long

The y-coordinate in the destination image where the method copies the source.

Example

' This example copies a 50 x 100 square with pixel value 255
' into the image in Viewer1.

Dim i As New CWIMAQImage

' Populate i
i.SetSize 50, 100
CWIMAQVision1.FillImage i, 255

' Copy i into the image in Viewer1
CWIMAQVision1.ImageToImage i, CWIMAQViewer1.Image, 20, 40