Initialize Method

NI Vision for Visual Basic

Initialize Method

Syntax

CWIMAQAnnulus.Initialize CenterX, CenterY, InnerRadius, OuterRadius, StartAngle, EndAngle

Purpose

Sets all the properties of the annulus with one method call.

Parameters

CenterX As Single

The x-coordinate of the center point.

CenterY As Single

The y-coordinate of the center point.

InnerRadius As Single

The internal radius.

OuterRadius As Single

The external radius.

StartAngle As Single

The start angle, in degrees.

EndAngle As Single

The end angle, in degrees.

Example

Private Sub Run_Click()
    Dim Annulus1 As New CWIMAQAnnulus
    Dim Annulus2 As New CWIMAQAnnulus
    
    'Initialize the first annulus.
    Annulus1.Initialize 50, 50, 5, 40, 45, 315
    
    'Copy the properties from the first annulus into the second annulus.
    Annulus1.CopyTo Annulus2
    
    'Move the first annulus. The move does not affect the second annulus.
    Annulus1.Center.X = Annulus1.Center.X + 70
    Annulus1.Center.Y = Annulus1.Center.Y + 70
    
    'Add the annuluses to the viewer's regions collection.
    CWIMAQViewer1.Regions.AddAnnulus Annulus1
    CWIMAQViewer1.Regions.AddAnnulus Annulus2
End Sub

See Also

CWIMAQRegions.AddAnnulus

CopyTo