short Escape(hdc, END_PATH, sizeof(PATH_INFO),lpInData, NULL)
The END_PATH printer escape ends a path. A path is a connected sequence of primitives drawn in succession to form a single polyline or polygon. Paths enable applications to draw complex borders, filled shapes, and clipping regions by supplying a collection of other primitives to define the desired shape.
Printer escapes that support paths enable applications to render images on sophisticated devices, such as PostScript printers, without generating huge polygons to simulate them.
To draw a path, an application first issues the BEGIN_PATH escape. Then it draws the primitives defining the border of the desired shape and issues an END_PATH escape.
The END_PATH escape takes, as a parameter, a pointer to a structure specifying the manner in which the path is to be rendered. The structure specifies whether or not the path is to be drawn and whether it is open or closed. Open paths define polylines, and closed paths define fillable polygons.
hdc
HDC Identifies the device context.
lpInData
PATH_INFO FAR * Points to a PATH_INFO structure that defines how the path is to be rendered. For more information about this structure, see the following Comments section.
The return value specifies the current path nesting level. This value is the number of BEGIN_PATH escape calls without a corresponding END_PATH call if the escape is successful. Otherwise, it is –1.
This escape is used only by PostScript printer drivers.
An application may begin a subpath within another path. If the subpath is closed, it is treated just like a polygon. If it is open, it is treated just like a polyline.
An application may use the CLIP_TO_PATH escape to define a clipping region corresponding to the interior or exterior of the currently open path.
The lpInData parameter points to a PATH_INFO structure that specifies how to render the path. This structure has the following form:
struct PATH_INFO {
short RenderMode;
BYTE FillMode;
BYTE BkMode;
LOGPEN Pen;
LOGBRUSH Brush;
DWORD BkColor;
};
Following are the members in the PATH_INFO structure:
RenderMode
Specifies how the path is to be rendered. It can be one of the following values:
Value | Meaning |
NO_DISPLAY (0) | Path is not drawn. |
OPEN (1) | Path is drawn as an open polygon. |
CLOSED (2) | Path is drawn as a closed polygon. |
FillMode
Specifies how the path is to be filled. It can be one of the following values:
Value | Meaning |
ALTERNATE (1) | Fill is done using the alternate fill algorithm. |
WINDING (2) | Fill is done using the winding fill algorithm. |
BkMode
Specifies the background mode for filling the path. It can be one of the following values:
Value | Meaning |
OPAQUE | Background is filled with the background color before the brush is drawn. |
TRANSPARENT | Background is not changed. |
Pen
Specifies the pen with which the path is to be drawn. If the RenderMode function is set to the NO_DISPLAY value, the pen is ignored.
Brush
Specifies the brush with which the path is to be filled. If the RenderMode function is set to the NO_DISPLAY or OPEN value, the brush is ignored.
BkColor
Specifies the color with which the path is filled if the BkMode function is set to the OPAQUE value.