About Paths

A path is one of the objects associated with a device context (DC). However, unlike the default objects (the pen, the brush, and the font) that are part of any new DC, there is no default path. For more information about DCs, see Device Contexts.

To create a path and select it into a DC, it is first necessary to define the points that describe it. This is done by calling the BeginPath function, specifying the appropriate drawing functions, and then by calling the EndPath function. This combination of functions (BeginPath, drawing functions, and EndPath) constitute a path bracket.

Windows NT: The following functions can be used in a path bracket.

AngleArc LineTo Polyline
Arc MoveToEx PolylineTo
ArcTo Pie PolyPolygon
Chord PolyBezier PolyPolyline
CloseFigure PolyBezierTo Rectangle
Ellipse PolyDraw RoundRect
ExtTextOut Polygon TextOut

Windows 95 and Windows 98: When constructing a path, only the CloseFigure, ExtTextOut, LineTo, MoveToEx, PolyBezier, PolyBezierTo, Polygon, Polyline, PolylineTo, PolyPolygon, PolyPolyline, and TextOut functions are recorded.

When an application calls EndPath, the system selects the associated path into the specified DC. (If another path had previously been selected into the DC, the system deletes that path without saving it.) After the system selects the path into the DC, an application can operate on the path in one of the following ways: