Jump to content

GpiEndPath: Difference between revisions

From EDM2
Created page with "This function ends the specification of a path started by GpiBeginPath. ==Syntax== GpiEndPath(hps); ==Parameters== ;hps (HPS) - input :Presentation-space handle. ==Retur..."
 
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
This function ends the specification of a path started by GpiBeginPath.  
This function ends the specification of a path started by [[GpiBeginPath]].


==Syntax==
==Syntax==
  GpiEndPath(hps);
  GpiEndPath(hps)
 
==Parameters==
==Parameters==
;hps (HPS) - input  
;hps ([[HPS]]) - input:Presentation-space handle.
:Presentation-space handle.  


==Returns==
==Returns==
;rc (BOOL) - returns  
;rc ([[BOOL]]) - returns:Success indicator.
:Success indicator.  
:*TRUE Successful completion
 
:*FALSE Error occurred.
:*TRUE Successful completion  
Possible returns from WinGetLastError:
:*FALSE Error occurred.  
: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.
Possible returns from WinGetLastError  
:PMERR_NOT_IN_PATH (0x20E1) An attempt was made to end a path using GpiEndPath or during segment drawing while not in a path bracket.
 
:;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_NOT_IN_PATH (0x20E1)  
::An attempt was made to end a path using GpiEndPath or during segment drawing while not in a path bracket.  
 
==Calling Sequence==
<PRE>
#define INCL_GPIPATHS /* Or use INCL_GPI, INCL_PM, */
#include <os2.h>
 
HPS    hps;  /*  Presentation-space handle. */
BOOL    rc;  /*  Success indicator. */
 
rc = GpiEndPath(hps);
</PRE>


==Example Source Code==
==Example Source Code==
This example uses the GpiEndPath function to end a path bracket. When the path bracket is ended, a subsequent call to the GpiFillPath function draws and fills the path.  
This example uses the GpiEndPath function to end a path bracket. When the path bracket is ended, a subsequent call to the [[GpiFillPath]] function draws and fills the path.
<PRE>
<PRE>
#define INCL_GPIPATHS          /* GPI Path functions          */
#define INCL_GPIPATHS          /* GPI Path functions          */
Line 55: Line 35:


==Prerequisite Functions==
==Prerequisite Functions==
* [[GpiBeginPath]]
*[[GpiBeginPath]]


==Related Functions==
==Related Functions==
*GpiFillPath  
* [[GpiFillPath]]
*GpiModifyPath  
* [[GpiModifyPath]]
*GpiOutlinePath  
* [[GpiOutlinePath]]
*GpiPathToRegion  
* [[GpiPathToRegion]]
*GpiPop  
* [[GpiPop]]
*GpiSetAttrMode  
* [[GpiSetAttrMode]]
*GpiSetAttrs  
* [[GpiSetAttrs]]
*GpiSetBackColor  
* [[GpiSetBackColor]]
*GpiSetBackMix  
* [[GpiSetBackMix]]
*GpiSetClipPath  
* [[GpiSetClipPath]]
*GpiSetColor  
* [[GpiSetColor]]
*GpiSetDefAttrs  
* [[GpiSetDefAttrs]]
*GpiSetLineEnd  
* [[GpiSetLineEnd]]
*GpiSetLineJoin  
* [[GpiSetLineJoin]]
*GpiSetLineType  
* [[GpiSetLineType]]
*GpiSetLineWidth  
* [[GpiSetLineWidth]]
*GpiSetLineWidthGeom  
* [[GpiSetLineWidthGeom]]
*GpiSetMix  
* [[GpiSetMix]]
*GpiStrokePath  
* [[GpiStrokePath]]
 


[[Category:gpi]]
[[Category:Gpi]]

Latest revision as of 19:34, 7 April 2025

This function ends the specification of a path started by GpiBeginPath.

Syntax

GpiEndPath(hps)

Parameters

hps (HPS) - input
Presentation-space handle.

Returns

rc (BOOL) - returns
Success indicator.
  • TRUE Successful completion
  • FALSE Error occurred.

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_NOT_IN_PATH (0x20E1) An attempt was made to end a path using GpiEndPath or during segment drawing while not in a path bracket.

Example Source Code

This example uses the GpiEndPath function to end a path bracket. When the path bracket is ended, a subsequent call to the GpiFillPath function draws and fills the path.

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

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   */
GpiFillPath(hps, 1L, FPATH_ALTERNATE); /* draw and fill the path */

Prerequisite Functions

Related Functions