Jump to content

GpiPointArc

From EDM2

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

#define INCL_GPIPRIMITIVES /* Or use INCL_GPI, INCL_PM, */
#include <os2.h>

HPS     hps;    /* Presentation-space handle. */
PPOINTL pptl2;  /* Intermediate and end points. */
LONG    lHits;  /* Correlation and error indicators. */

lHits = GpiPointArc(hps, pptl2);

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