GpiStrokePath

From EDM2
Jump to: navigation, search

This function strokes a path, and then draws it.

Syntax

GpiStrokePath (hps, lPath, flOptions)

Parameters

hps (HPS) - input 
Presentation-space handle.
lPath (LONG) - input 
Identifier of path to be stroked; it must be 1.
flOptions (ULONG) - input 
Stroke option.
Reserved; must be 0.

Return Code

lHits (LONG) - returns 
Correlation and error indicators.
  • GPI_OK Successful
  • GPI_HITS Correlate hits
  • GPI_ERROR Error

Errors

Possible returns from WinGetLastError

PMERR_INV_HPS (0x207F) 
An invalid presentation-space handle was specified.
PMERR_PS_BUSY (0x20F4) 
An attempt was made to access the presentation space from more than one thread simultaneously.
PMERR_INV_PATH_ID (0x20AE) 
An invalid path identifier parameter was specified.
PMERR_INV_RESERVED_FIELD (0x20C1) 
An invalid reserved field was specified.
PMERR_PATH_UNKNOWN (0x20EE) 
An attempt was made to perform a path function on a path that did not exist.

Remarks

The path is first converted to one that describes the envelope of a wide line stroked using the current geometric line-width attribute (see GpiSetLineWidthGeom).

Note: This function and GpiModifyPath are the only calls that can cause geometric wide lines to be constructed. For more details about the way in which the envelope is constructed, see GpiModifyPath. The converted path is then filled, using winding mode area fill and the area attributes. The boundaries of the wide line are included in the fill.

When it has been drawn, the path is deleted.

This function is equivalent to GpiModifyPath, followed by GpiFillPath. It is provided to enable device drivers to optimize storage, if possible.

If the current drawing mode (see GpiSetDrawingMode) is draw or draw-and-retain, drawing occurs on the currently associated device. If the drawing mode is retain, this function is stored in the current segment and output occurs when the segment is subsequently drawn in the usual way.

Graphic Elements and Orders

Element Type: OCODE_GFPTH Note that GpiFillPath also generates this element type. Order: Fill Path

Example Code

This example uses the GpiStrokePath function to draw a wide line.

#define INCL_GPIPATHS
#include <OS2.H>

HPS hps;         /* Presentation space handle. */
POINTL ptlStart = { 0, 0 };
POINTL ptlTriangle[] = { 100, 100, 200, 0, 0, 0 };

/* create the path */

GpiBeginPath(hps, 1L);
GpiMove(hps, &ptlStart);
GpiPolyLine(hps, 3, ptlTriangle);
GpiEndPath(hps);

GpiSetLineWidthGeom(hps, 20L);   /* set the line width */
GpiStrokePath(hps, 1L, 0L);      /* draw the wide line */

Related Functions

  • GpiBeginArea
  • GpiBeginPath
  • GpiEndPath
  • GpiFillPath
  • GpiModifyPath
  • GpiOutlinePath
  • GpiPathToRegion
  • GpiSetAttrs
  • GpiSetDefAttrs
  • GpiSetClipPath
  • GpiSetLineEnd
  • GpiSetLineJoin
  • GpiSetLineType
  • GpiSetLineWidth
  • GpiSetLineWidthGeom