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.VisionProAssembly: Cognex.VisionPro.Core (in Cognex.VisionPro.Core.dll) Version: 75.0.0.0
Syntax
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 Type | Reason |
|---|---|
| CogPolygon Changed | Fires when a vertex is added. The following state flags may be affected: |
Exceptions
| Exception | Condition |
|---|---|
| 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