Image drawing

[Circles] [Lines] [Splines]

This page contains source code demonstrating how to draw the primitives commonly used in paint programs.

Drawing circles

Screen shot

This source code demonstrates how to draw solid circles.

To download the Pascal source code (1k), click here.
To download the C source code (1k), click here.

Drawing lines

This source code demonstrates how to draw lines.

To download the Pascal source code (1k), click here.
To download the C source code (1k), click here.

Drawing splines

Screen shot

This code demonstrates how to draw curved lines through control points. (Catmull-Rom splines)

To download the Pascal source code (2k), click here.
To download the C source code (2k), click here.