AddOval Method

NI Vision for Visual Basic

AddOval Method

Syntax

CWIMAQRegions.AddOval Oval

Return Type

CWIMAQRegion

The region object that was added.

Purpose

Adds an oval region to the regions collection.

Remarks

This method makes a copy of the input oval.

Parameters

Oval As CWIMAQOval

The oval to add.

Example

Private Sub Run_Click()
    'Create an oval
    Dim Oval As New CWIMAQOval
    Oval.Initialize 30, 60, 90, 45
    
    'Add the oval to the viewer's regions collection.
    CWIMAQViewer1.Regions.AddOval Oval

    If TypeName(Oval) = "Nothing" Then
    MsgBox "Number of ovals exceeded!"
    Else
    MsgBox "You added an oval." 
    End If
End Sub