GpiErase
This function clears the output display of the device context associated with the specified presentation space, to the reset color (CLR_BACKGROUND; see GpiSetColor).
Contents
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.
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);
Sample
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 Reference for more information.
Related Functions
- GpiCreateLogColorTable
- GpiSelectPalette
- GpiSetColor
- GpiSetDrawControl