CogPolygon AddVertex Method Cognex VisionPro 9.25 SR1
Add a vertex to the polygon. If the default index -1 is used, the new vertex will be added to the end of any existing vertices. Otherwise Index must be >= 0 and <= NumVertices.

Namespace: Cognex.VisionPro
Assembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 93.1.0.0
Syntax

public void AddVertex(
	double x,
	double y,
	int index
)

Parameters

x
Type: System Double

X-coordinate of the vertex.

y
Type: System Double

Y-coordinate of the vertex.

index
Type: System Int32

Index of the vertex.

Events

Event TypeReason
CogPolygon Changed

Fires when a vertex is added.

The following state flags may be affected:

    Exceptions

    ExceptionCondition
    ArgumentException

    index < −1

    ArgumentException

    index > NumVertices

    OUTOFMEMORYException

    The memory to store the vertices cannot be allocated.

    Remarks

    Add a vertex to the polygon at the given index. If index is −1 or NumVertices, the vertex is added to the end.

    See Also