O'Reilly logo

Delphi for .NET Developer’s Guide by Xavier Pacheco

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required