Easy Way to Learn ASP.NET

GDI+ Tutorial

GDI+ Introduction
GDI+ Lines
GDI+ Rectangles
GDI+ Ellipses
GDI+ Arcs
GDI+ Polygons
GDI+ Cardinal Splines
GDI+ Bezier Splines
GDI+ Graphics Paths
GDI+ Brushes
GDI+ Regions
GDI+ Antialiasing
GDI+ Bitmaps
GDI+ Metafiles
GDI+ Transformations
GDI+ Text

Drawing Cardinal Splines Using GDI+

A cardinal spline is a sequence of individual curves joined to form a larger curve. The spline is specified by an array of points and a tension parameter.

The following illustration shows a set of points and a cardinal spline that passes through each point in the set.

Cardinal Spline 


Drawing a Cardinal Spline

To draw a cardinal spline, you need a Graphics object, a Pen object, and the third parameter is a tension.

Call DrawCurve method to draw a cardinal spline. The Pen object, array of point, and tension are passed as arguments.

The following is the syntax of DrawCurve method:

DrawCurve(ByVal pen As System.Drawing.Pen, ByVal points() As System.Drawing.Point, ByVal tension As Single)

The following code example demonstrates how to draw a cardinal spline: