CopyTo Method

NI Vision for Visual Basic

CopyTo Method

Syntax

CWIMAQPoint.CopyTo DestPoint

Purpose

Copies the source point into the destination point.

Parameters

DestPoint As CWIMAQPoint

The destination point object.

Example

Private Sub Run_Click()
    Dim Point1 As New CWIMAQPoint
    Dim Point2 As New CWIMAQPoint
    
    'Initialize the first point
    Point1.Initialize 19, 81
    
    'Copy the properties from the first point into the second point
    Point1.CopyTo Point2
    
    'Move the first point. This move does not affect the second point
    Point1.X = Point1.X + 70
    Point1.Y = Point1.Y + 70
    
    'Add the points to the viewer's regions collection.
    CWIMAQViewer1.Regions.AddPoint Point1
    CWIMAQViewer1.Regions.AddPoint Point2
End Sub