Jump to content

GpiErase: Difference between revisions

From EDM2
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..."
 
No edit summary
 
(2 intermediate revisions by 2 users not shown)
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.
:;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==
==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 36: Line 28:
</PRE>
</PRE>


==Sample==
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 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.  


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==
*GpiCreateLogColorTable  
*[[GpiCreateLogColorTable]]
*GpiSelectPalette  
*[[GpiSelectPalette]]
*GpiSetColor  
*[[GpiSetColor]]
*GpiSetDrawControl  
*[[GpiSetDrawControl]]
 


[[Category:gpi]]
[[Category:Gpi]]

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.

Related Functions