Drawing Curves

.NET supports two forms of curves. These are the cardinal spline and the Bezier spline. In general, curves are represented by a line passing through points on the drawing surface in a particular direction. Curve tension is based on the pull from points outside of the curve’s line.

The Cardinal Spline

The cardinal spline is defined by a line that passes directly through the array of points. A tension value determines the bend of the line. When the tension is lower, the curve’s bend will be flatter. Listing 7.6 shows the code for drawing a cardinal spline.

Listing 7.6. Drawing the Cardinal Spline
1: procedure TWinForm.paintCardinal; 2: var 3: MyPointsAry: array[0..2] of Point; 4: begin 5: MyPen.Color := Color.Blue; 6: MyPen.Width ...

Get Delphi for .NET Developer’s Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.