How to Get a Connector Vertex Point

4 Jan 20181 minute to read

Connector has a method called GetPoint to get its vertex point.

This method has two parameters: int and bool

  • int specifies the vertex point in the local coordinates
  • bool specifies the path of the connector

Set the bool parameter to true to get the connector vertex point based on its graphical path and false to get the connector point based on its relative path.

The following code snippet illustrates this:

//LineConnector

ConnectorBase Connector = new LineConnector(new Drawing.PointF(0F, 0F), new Drawing.PointF(10F, 10F));

//set points

Connector.SetPoints(new PointF[2] { Connector.GetPoint(0), Connector.GetPoint(Connector.GetPoints().GetLength(0) - 1, false) });
'LineConnector

Dim Connector As ConnectorBase = New LineConnector(New Drawing.PointF(0.0F, 0.0F), New Drawing.PointF(10.0F, 10.0F))

'set points

Connector.SetPoints(New PointF(1) {Connector.GetPoint(0), Connector.GetPoint(Connector.GetPoints().GetLength(0) - 1, False)})