GpiCloseFigure: Difference between revisions
mNo edit summary |
mNo edit summary |
||
Line 5: | Line 5: | ||
==Parameters== | ==Parameters== | ||
; hps (HPS) - input : Presentation-space handle. | ;hps (HPS) - input : Presentation-space handle. | ||
==Return Code== | ==Return Code== | ||
; rc (BOOL) - returns : Success indicator. | ;rc (BOOL) - returns : Success indicator. | ||
* TRUE Successful completion | * TRUE Successful completion | ||
* FALSE Error occurred. | * FALSE Error occurred. | ||
Line 20: | Line 20: | ||
The current figure is closed by a line drawn to the start point of the figure. | The current figure is closed by a line drawn to the start point of the figure. | ||
This function need not be used if the path is to be filled (see GpiFillPath), or used as a clip path (see GpiSetClipPath), as any figures in the path that have not been closed are automatically closed at that time. It should be used, however, for any closed figures within paths that are subsequently to be stroked by GpiModifyPath or [[GpiStrokePath]]. | This function need not be used if the path is to be filled (see [[GpiFillPath]]), or used as a clip path (see [[GpiSetClipPath]]), as any figures in the path that have not been closed are automatically closed at that time. It should be used, however, for any closed figures within paths that are subsequently to be stroked by [[GpiModifyPath]] or [[GpiStrokePath]]. | ||
This function must not be used outside a path specification. In particular, it must not be used within an area. | This function must not be used outside a path specification. In particular, it must not be used within an area. | ||
Line 47: | Line 47: | ||
==Related Functions== | ==Related Functions== | ||
Prerequisite Functions | Prerequisite Functions | ||
*GpiBeginPath | *[[GpiBeginPath]] | ||
Related Functions | Related Functions | ||
*GpiEndPath | *[[GpiEndPath]] | ||
*GpiModifyPath | *[[GpiModifyPath]] | ||
*[[GpiStrokePath]] | *[[GpiStrokePath]] | ||
[[Category:Gpi]] | [[Category:Gpi]] |
Revision as of 12:49, 5 March 2020
This function closes a figure within a path specification.
Syntax
GpiCloseFigure(hps)
Parameters
- hps (HPS) - input
- Presentation-space handle.
Return Code
- rc (BOOL) - returns
- Success indicator.
- TRUE Successful completion
- FALSE Error occurred.
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.
Remarks
The current figure is closed by a line drawn to the start point of the figure.
This function need not be used if the path is to be filled (see GpiFillPath), or used as a clip path (see GpiSetClipPath), as any figures in the path that have not been closed are automatically closed at that time. It should be used, however, for any closed figures within paths that are subsequently to be stroked by GpiModifyPath or GpiStrokePath.
This function must not be used outside a path specification. In particular, it must not be used within an area.
Graphic Elements and Orders
Element Type: OCODE_GCFIG Order: Close Figure
Example Code
This example uses the GpiCloseFigure function to close a triangle drawn in a path bracket. The triangle starts at (0,0), and as the current position just before the GpiCloseFigure is (200,0), the function closes the triangle by drawing a line from (200,0) to (0,0).
#define INCL_GPIPATHS /* GPI Path functions */ #include <os2.h> HPS hps; /* presentation space handle */ POINTL ptlStart = { 0, 0 }; POINTL ptlPoints[] = { 100, 100, 200, 0 }; GpiBeginPath(hps, 1L); /* start the path bracket */ GpiMove(hps, &ptlStart); /* move to starting point */ GpiPolyLine(hps, 2L, ptlPoints); /* draw two sides */ GpiCloseFigure(hps); /* close the triangle */ GpiEndPath(hps); /* end the path bracket */
Related Functions
Prerequisite Functions
Related Functions