END_PATH

  #define END_PATH 4098    

  short Control(lpDevice, END_PATH, lpInfo, NULL)    
  LPPDEVICE lpDevice;    
  LPPATH_INFO lpInfo;    

The END_PATH 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 areas by supplying a collection of other primitives defining the desired shape.

Printer escapes that support paths enable applications to render images on
sophisticated devices such as PostScript printers without generating huge poly-gons to simulate them.

To draw a path, an application first issues the BEGIN_PATH escape. It then draws the primitives defining the border of the desired shape, and issues an END_PATH escape.

The END_PATH escape takes a pointer to a structure as a parameter, 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 or not it is open or closed. Open paths define polylines, and closed paths define polygons that can be filled.

Parameters

lpDevice

Points to a PDEVICE structure specifying the destination device.

lpInfo

Points to a PATH_INFO structure. The PATH_INFO structure has the following form:

typedef struct tagPATH_INFO {

short RenderMode;

BYTE FillMode;

BYTE BkMode;

LPEN Pen;

LBRUSH Brush;

DWORD BkColor;

} PATH_INFO;

Return Value

This escape returns a short integer value specifying the current path nesting
level. If the escape is successful, the number of BEGIN_PATH calls without a
corresponding END_PATH call is the result. Otherwise, -1 is the result.

Comments

You may draw a path within another path. A path drawn within another path is treated exactly like a polygon (if the subpath is closed) or a polyline (if the subpath is open).

You may use the CLIP_TO_PATH escape to define a clipping area corresponding to the interior or exterior of the currently open path.

Device drivers that implement this escape must also implement the BEGIN_PATH and EXT_DEVICE_CAPS escapes and should also implement the SET_ARC_DIRECTION escape.

See Also

BEGIN_PATH, CLIP_TO_PATH, EXT_DEVICE_CAPS, SET_ARC_DIRECTION