Jump to content

GpiOutlinePath

From EDM2
Revision as of 05:06, 21 February 2020 by Martini (talk | contribs) (Created page with "This function draws the outline of a path. ==Syntax== GpiOutlinePath(hps, lPath, lOptions); ==Parameters== ;hps (HPS) - input :Presentation-space handle. ;lPath (LONG) - ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function draws the outline of a path.

Syntax

GpiOutlinePath(hps, lPath, lOptions);

Parameters

hps (HPS) - input
Presentation-space handle.
lPath (LONG) - input
Identifier of path to be outlined; it must be 1.
lOptions (LONG) - input
Options.
Reserved; must be 0.

Returns

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

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.

Calling Sequence

#define INCL_GPIPATHS /* Or use INCL_GPI, INCL_PM, */
#include <os2.h>

HPS     hps;       /*  Presentation-space handle. */
LONG    lPath;     /*  Identifier of path to be outlined; it must be 1. */
LONG    lOptions;  /*  Options. */
LONG    lHits;     /*  Correlation and error indicators. */

lHits = GpiOutlinePath(hps, lPath, lOptions);


Example Source Code

This example uses GpiOutlinePath to draw the outline of a path (in this case a triangle).


#define INCL_GPIPATHS           /* Path functions               */
#include <os2.h>

LONG   lHits;           /* correlation/error indicator          */
HPS    hps;             /* Presentation-space handle            */
POINTL ptlStart = { 0, 0 }; /* first vertex                     */
POINTL ptlTriangle[] = { 100, 100, 200, 0, 0, 0 }; /* vertices  */

GpiBeginPath(hps, 1L);                 /* start the path bracket */
GpiMove(hps, &ptlStart);               /* move to starting point */
GpiPolyLine(hps, 2L, ptlTriangle);     /* draw the three sides   */
GpiCloseFigure(hps);                   /* close the triangle     */
GpiEndPath(hps);                       /* end the path bracket   */
 .
 .
lHits = GpiOutlinePath(hps, 1L, 0L);


Remarks

The outline of the path is drawn, using the line attributes, including cosmetic line width (see GpiSetLineWidth) but not geometric line width (see GpiSetLineWidthGeom). This normally has the same effect as if the lines, curves, and so on, which comprise the path, had been drawn without defining them as being within a path. However, if character strings (referencing outline fonts) are contained within the path, the outlines of the characters, without the interior fill, are drawn by GpiOutlinePath, giving the appearance of hollow characters.

Open figures within the path are not closed automatically.

When the outline of the path has been drawn, the path is deleted.

Graphic Elements and Orders

Element Type: OCODE_GOPTH

Order: Outline Path

Related Functions

  • GpiBeginPath
  • GpiEndPath
  • GpiFillPath
  • GpiModifyPath
  • GpiPathToRegion
  • GpiPop
  • GpiSetAttrMode
  • GpiSetAttrs
  • GpiSetBackColor
  • GpiSetBackMix
  • GpiSetClipPath
  • GpiSetColor
  • GpiSetDefAttrs
  • GpiSetLineEnd
  • GpiSetLineJoin
  • GpiSetLineType
  • GpiSetLineWidth
  • GpiSetMix
  • GpiStrokePath