Jump to content

GpiEndArea: Difference between revisions

From EDM2
Created page with "This function ends the construction of a shaded area. ==Syntax== <PRE> #define INCL_GPIPRIMITIVES Or use INCL_GPI, INCL_PM, Also in COMMON section: #include <os2.h> HPS..."
 
Ak120 (talk | contribs)
mNo edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 2: Line 2:


==Syntax==
==Syntax==
<PRE>
GpiEndArea (hps)
#define INCL_GPIPRIMITIVES /* Or use INCL_GPI, INCL_PM, Also in COMMON section */
#include <os2.h>


HPS hps;      /* Presentation-space handle. */
LONG lHits;    /* Correlation and error indicators. */
lHits = GpiEndArea(hps);
</PRE>
==Parameters==
==Parameters==
; hps (HPS) - input : Presentation-space handle.
;hps (HPS) - input : Presentation-space handle.


==Return Code==
==Return Code==
; lHits (LONG) - returns : Correlation and error indicators.
; lHits (LONG) - returns : Correlation and error indicators.
* GPI_OK Successful
::GPI_OK - Successful
* GPI_HITS Correlate hits
::GPI_HITS - Correlate hits
* GPI_ERROR Error.
::GPI_ERROR - Error.


==Errors==  
==Errors==  
Possible returns from WinGetLastError
Possible returns from WinGetLastError:
* PMERR_INV_HPS (0x207F) : An invalid presentation-space handle was specified.
* 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.
* PMERR_PS_BUSY (0x20F4) : An attempt was made to access the presentation space from more than one thread simultaneously.
* PMERR_NOT_IN_AREA (0x20DD) : An attempt was made to end an area using GpiEndArea or during segment drawing while not in an area bracket.
* PMERR_NOT_IN_AREA (0x20DD) : An attempt was made to end an area using ''GpiEndArea'' or during segment drawing while not in an area bracket.
* PMERR_COORDINATE_OVERFLOW (0x2014) : An internal coordinate overflow error occurred. This can occur if coordinates or matrix transformation elements (or both) are invalid or too large.
* PMERR_COORDINATE_OVERFLOW (0x2014) : An internal coordinate overflow error occurred. This can occur if coordinates or matrix transformation elements (or both) are invalid or too large.


==Remarks==
==Remarks==
The construction is started by the GpiBeginArea function. If necessary, a final line is constructed (to the starting point of the last figure) to close the area.
The construction is started by the [[GpiBeginArea]] function. If necessary, a final line is constructed (to the starting point of the last figure) to close the area.


The current position is not changed, unless a closure line has to be drawn, in which case the current position is moved to the end point of the line.
The current position is not changed, unless a closure line has to be drawn, in which case the current position is moved to the end point of the line.
Line 37: Line 30:


==Example Code==
==Example Code==
This example uses the GpiEndArea function to end an area bracket. The function draws the area (a triangle) by filling the outline with the current fill pattern.
This example uses the ''GpiEndArea'' function to end an area bracket. The function draws the area (a triangle) by filling the outline with the current fill pattern.
<PRE>
<PRE>
#define INCL_GPIPRIMITIVES      /* GPI primitive functions */
#define INCL_GPIPRIMITIVES      /* GPI primitive functions */

Latest revision as of 20:51, 23 April 2025

This function ends the construction of a shaded area.

Syntax

GpiEndArea (hps)

Parameters

hps (HPS) - input
Presentation-space handle.

Return Code

lHits (LONG) - returns
Correlation and error indicators.
GPI_OK - Successful
GPI_HITS - Correlate hits
GPI_ERROR - Error.

Errors

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.
  • PMERR_NOT_IN_AREA (0x20DD) : An attempt was made to end an area using GpiEndArea or during segment drawing while not in an area bracket.
  • PMERR_COORDINATE_OVERFLOW (0x2014) : An internal coordinate overflow error occurred. This can occur if coordinates or matrix transformation elements (or both) are invalid or too large.

Remarks

The construction is started by the GpiBeginArea function. If necessary, a final line is constructed (to the starting point of the last figure) to close the area.

The current position is not changed, unless a closure line has to be drawn, in which case the current position is moved to the end point of the line.

Graphic Elements and Orders

Element Type: OCODE_GEAR Order: End Area

Example Code

This example uses the GpiEndArea function to end an area bracket. The function draws the area (a triangle) by filling the outline with the current fill pattern.

#define INCL_GPIPRIMITIVES       /* GPI primitive functions */
#include <os2.h>

HPS hps;                         /* presentation space handle */
POINTL ptlStart = { 0, 0 };      /* first vertex */
POINTL ptlTriangle[] = { 100, 100, 200, 0, 0, 0 }; /* vertices */

GpiBeginArea(hps, BA_NOBOUNDARY | BA_ALTERNATE);
GpiMove(hps, &ptlStart);
GpiPolyLine(hps, 3L, ptlTriangle);
GpiEndArea(hps);

Related Functions

Prerequisite Functions

Related Functions