MaxContours Property

NI Vision for Visual Basic

MaxContours Property

Syntax

CWIMAQViewer.MaxContours

Data Type

Long

Purpose

Maximum number of contours the viewer can have in its ROI.

Remarks

If this property is negative, it indicates there is no limit on the maximum number of contours. If the maximum number of contours is reached, and you add a contour with either CWIMAQViewer.Regions.Add, which is deprecated, or one of the CWIMAQViewer.Regions.Add methods, such as AddAnnulus, use TypeName() <> "Nothing" to check the validity of the returned data. The following code excerpt shows how to perform this check:

Example

Dim rectangle As CWIMAQRectangle
Set rectangle = CWIMAQViewer1.Regions.Add
If TypeName(rectangle) = "Nothing" Then
    MsgBox "Number of contours exceeded!"
Else
    MsgBox "You added a contour."
End If