GpiErase: Difference between revisions
Created page with "This function clears the output display of the device context associated with the specified presentation space, to the reset color (CLR_BACKGROUND; see GpiSetColor). ==Synta..." |
mNo 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 | ;hps (HPS) - input:Presentation-space handle. | ||
:Presentation-space handle. | |||
==Return Code== | ==Return Code== | ||
;rc (BOOL) - returns | ;rc (BOOL) - returns:Success indicator. | ||
:Success indicator. | ::TRUE - Successful completion | ||
::FALSE - Error occurred. | |||
: | |||
: | |||
Possible returns from WinGetLastError | Possible returns from WinGetLastError | ||
;PMERR_INV_HPS (0x207F) | ;PMERR_INV_HPS (0x207F):An invalid presentation-space handle was specified. | ||
: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_PS_BUSY (0x20F4) | |||
:An attempt was made to access the presentation space from more than one thread simultaneously. | |||
==Calling Sequence== | ==Calling Sequence== | ||
Line 49: | Line 40: | ||
GpiMove(hps, &ptlStart); /* draw a triangle */ | GpiMove(hps, &ptlStart); /* draw a triangle */ | ||
GpiPolyLine(hps, 3L, ptlTriangle); | GpiPolyLine(hps, 3L, ptlTriangle); | ||
</PRE> | </PRE> | ||
==Remarks== | ==Remarks== | ||
This operation is independent of the draw controls; see GpiSetDrawControl. | 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. | 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 | 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== | ==Related Functions== | ||
*GpiCreateLogColorTable | *GpiCreateLogColorTable | ||
*GpiSelectPalette | *GpiSelectPalette | ||
*GpiSetColor | *GpiSetColor | ||
*GpiSetDrawControl | *GpiSetDrawControl | ||
[[Category: | [[Category:Gpi]] |
Revision as of 08:00, 29 February 2020
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.
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