TransformRegions Method

NI Vision for Visual Basic

TransformRegions Method

Syntax

CWIMAQVision.TransformRegions SourceRegions, DestinationRegions, ReferenceCoordinateSystem, MeasurementCoordinateSystem

Return Type

Long

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

Purpose

Rotates and translates a region in an image to transform the region from the ReferenceCoordinateSystem to the MeasurementCoordinateSystem.

Parameters

SourceRegions As CWIMAQRegions

The regions to transform.

DestinationRegions As CWIMAQRegions

On return, the transformed regions.

ReferenceCoordinateSystem As CWIMAQCoordinateSystem

The base coordinate system.

MeasurementCoordinateSystem As CWIMAQCoordinateSystem

The new coordinate system.

Example

Private Sub Run_Click()
    Dim regions As New CWIMAQRegions
    Dim baseCoordinateSystem As New CWIMAQCoordinateSystem
    Dim newCoordinateSystem As New CWIMAQCoordinateSystem
    
    ' Transform the regions on Viewer1 and
    ' store the result in regions.
    
    CWIMAQVision1.TransformRegions baseCoordinateSystem, _
                                   newCoordinateSystem, _
                                   CWIMAQViewer1.regions, regions
End Sub