The Fun and Fancy Stuff

Expressing font characters in terms of outlines opens up lots of potential in combining fonts with other graphics techniques. Earlier we saw how fonts can be rotated. This final section shows some other tricks. But before we continue, let’s look at two important preliminaries: graphics paths and extended pens.

The GDI Path

A path is a collection of straight lines and curves stored internally to GDI. Paths were introduced in the 32-bit versions of Windows. The path may initially seem similar to the region, and indeed you can convert a path to a region and use a path for clipping. However, we’ll see shortly how they differ.

To begin a path definition, you simply call

BeginPath (hdc) ;

After this call, any line you draw (such as ...

Get Programming Windows®, Fifth Edition 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.