GpiErase: Difference between revisions
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
This function clears the output display of the device context associated with the specified presentation space, to the reset color (CLR_BACKGROUND; see [[GpiSetColor]]). | This function clears the output display of the device context associated with the specified presentation space, to the reset color (CLR_BACKGROUND; see [[GpiSetColor]]). | ||
==Syntax== | ==Syntax== | ||
GpiErase(hps) | GpiErase(hps) | ||
==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. | ||
Latest revision as of 01:25, 20 September 2025
This function clears the output display of the device context associated with the specified presentation space, to the reset color (CLR_BACKGROUND; see GpiSetColor).
Syntax
GpiErase(hps)
Parameters
- hps (HPS) - input
- Presentation-space handle.
Return Code
- 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.
Example Code
Calling Sequence:
#define INCL_GPICONTROL /* Or use INCL_GPI, INCL_PM, Also in COMMON section */ #include <os2.h> HPS hps; /* Presentation-space handle. */ BOOL rc; /* Success indicator. */ rc = GpiErase(hps);
This example uses the GpiErase function to clear the display before drawing.
#define INCL_GPICONTROL /* GPI control Functions */
#include <os2.h>
HPS hps; /* presentation space handle */
POINTL ptlStart = { 0, 0 }; /* start point */
POINTL ptlTriangle[] = { 100, 100, 200, 0, 0, 0 }; /* vertices */
GpiErase(hps); /* clear the display */
GpiMove(hps, &ptlStart); /* draw a triangle */
GpiPolyLine(hps, 3L, ptlTriangle);
Remarks
This operation is independent of the draw controls; see GpiSetDrawControl.
The call is subject to all clipping currently in force; that is, clip path, viewing limits, graphics field, clip region, and visible region.
This function does not perform any bounds collection, or correlation.
Note: This function must not be used when creating metafiles conforming to System Application Architecture (SAA) guidelines; see "MetaFile Resolutions" in the Presentation Manager Programming Guide and Reference for more information.