NShape Programmer Tasks
Defining the Control Points

<< Click to Display Table of Contents >>

Navigation:  Programmer Tasks > Developing a New Shape Class >

NShape Programmer Tasks
Defining the Control Points

Previous pageReturn to chapter overviewNext page

Depending on the base class you used for the shape, it has already a couple of control points. You might want to disable some of these control points for connections. Another possibility is to add additional control points or remove some of the inherited ones.

To define the control points

1.Implement the HasControlPointCapability function to set the capabilities of a control point.

2.Implement the calculation of your control points.
When deriving from PathbasedShape, implement the CalcControlPoints method that calculates the (untransformed) positions of the control points and the ControlPointCount property to add additional control points or remove control points that are created by the base class.
You might also want to override the GetControlPointIds and GetControlPointPosition methods when removing control points of the base class.

The next step is to persist the new shape in its completeness, which is described in "Adding persistency support".

See Also

Programmer Tasks: Developing a new shape class