GpiErase: Difference between revisions
No edit summary |
|||
Line 16: | Line 16: | ||
;PMERR_PS_BUSY (0x20F4):An attempt was made to access the presentation space from more than one thread simultaneously. | ;PMERR_PS_BUSY (0x20F4):An attempt was made to access the presentation space from more than one thread simultaneously. | ||
==Calling Sequence | ==Example Code== | ||
Calling Sequence: | |||
<PRE> | <PRE> | ||
#define INCL_GPICONTROL /* Or use INCL_GPI, INCL_PM, Also in COMMON section */ | #define INCL_GPICONTROL /* Or use INCL_GPI, INCL_PM, Also in COMMON section */ | ||
Line 27: | Line 28: | ||
</PRE> | </PRE> | ||
This example uses the GpiErase function to clear the display before drawing. | This example uses the GpiErase function to clear the display before drawing. | ||
<PRE> | <PRE> | ||
Line 49: | Line 49: | ||
This function does not perform any bounds collection, or correlation. | 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 Reference'' for more information. | 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. | ||
==Related Functions== | ==Related Functions== |
Latest revision as of 23:36, 23 April 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.