Jump to content

GpiPointArc: Difference between revisions

From EDM2
Created page with "This function creates an arc, using the current arc parameters, through three points, starting at the current position. ==Syntax== GpiPointArc(hps, pptl2) ==Parameters== ; hps (HPS) - input : Presentation-space handle. ; pptl2 (PPOINTL) - input : Intermediate and end points. : Pointer to an array containing the intermediate and end points. ==Return Value== ; lHits (LONG) - returns : Correlation and error indicators. :; GPI_OK :: Successful :; GPI_HITS ::..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 5: Line 5:


==Parameters==
==Parameters==
; hps ([[HPS]]) - input
; hps ([[HPS]]) - input: Presentation-space handle.
: Presentation-space handle.
; pptl2 ([[PPOINTL]]) - input: Intermediate and end points.
 
; pptl2 ([[PPOINTL]]) - input
: Intermediate and end points.
: Pointer to an array containing the intermediate and end points.
: Pointer to an array containing the intermediate and end points.


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


==Remarks==
==Remarks==
Line 28: Line 21:
==Errors==
==Errors==
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)
; PMERR_INV_COORDINATE (0x205B): An invalid coordinate value was specified.
: An attempt was made to access the presentation space from more than one thread simultaneously.
; PMERR_INV_NESTED_FIGURES (0x20A8): Nested figures have been detected within a path definition.
; PMERR_INV_COORDINATE (0x205B)
: An invalid coordinate value was specified.
; PMERR_INV_NESTED_FIGURES (0x20A8)
: Nested figures have been detected within a path definition.


==Graphic Elements and Orders==
==Graphic Elements and Orders==
Line 42: Line 31:


==Example Code==
==Example Code==
<PRE>
#define INCL_GPIPRIMITIVES /* Or use INCL_GPI, INCL_PM, */
#include &lt;os2.h&gt;
HPS    hps;    /* Presentation-space handle. */
PPOINTL pptl2;  /* Intermediate and end points. */
LONG    lHits;  /* Correlation and error indicators. */
lHits = GpiPointArc(hps, pptl2);
</PRE>
This example uses the GpiPointArc function to draw an arc through the three points of a triangle. The GpiPolyLine function then draws the triangle.
This example uses the GpiPointArc function to draw an arc through the three points of a triangle. The GpiPolyLine function then draws the triangle.
<pre>
<pre>
#define INCL_GPIPRIMITIVES /* GPI primitive functions */
#define INCL_GPIPRIMITIVES /* GPI primitive functions */
#include &lt;os2.h&gt;
#include <os2.h>


HPS hps; /* presentation space handle */
HPS hps; /* presentation space handle */

Latest revision as of 00:42, 24 November 2025

This function creates an arc, using the current arc parameters, through three points, starting at the current position.

Syntax

GpiPointArc(hps, pptl2)

Parameters

hps (HPS) - input
Presentation-space handle.
pptl2 (PPOINTL) - input
Intermediate and end points.
Pointer to an array containing the intermediate and end points.

Return Value

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

Remarks

The first element of the pptl2 array defines an intermediate point along the arc, and the second element identifies the end point of the arc. Upon completion, current position is set to the end point of the arc.

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_INV_COORDINATE (0x205B)
An invalid coordinate value was specified.
PMERR_INV_NESTED_FIGURES (0x20A8)
Nested figures have been detected within a path definition.

Graphic Elements and Orders

Element Type
OCODE_GCARC

Order: Arc at Current Position

Example Code

This example uses the GpiPointArc function to draw an arc through the three points of a triangle. The GpiPolyLine function then draws the triangle.

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

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

GpiMove(hps, &ptlTriangle[0]); /* moves to start point (0, 0)*/
GpiPointArc(hps, &ptlTriangle[1]);/* draws the arc */

GpiMove(hps, &ptlTriangle[0]); /* moves to start point (0, 0)*/
/* draws the triangle */
GpiPolyLine(hps, 3L, &ptlTriangle[1]);

Related Functions