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 Lines

Having the ability to draw lines is fundamental to graphics development. GDI+ provides two key classes for line rendering. These are the Pen and Brush classes.

The Pen and Brush Classes

You use Pens to draw lines, shapes, and curves. The Pen can draw lines of different widths. You can also apply caps to lines (styles of endpoints to lines), and lines can be joined to form more complex shapes.

Brushes are used to fill a drawing surface. The surface area can be filled with a color, pattern, image, and texture.

This section covers various line techniques. In the example, there is a helper function that I’ll point out before I illustrate the various drawing samples. The first is a helper routine used to clear my drawing surface. This ...

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