Jump to content

GpiQueryArcParams

From EDM2
Revision as of 01:22, 17 November 2025 by Ak120 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function returns the current arc parameters used to draw full, partial, and 3-point arcs.

Syntax

GpiQueryArcParams(hps, parcpArcParams)

Parameters

hps (HPS) - input
Presentation-space handle.
parcpArcParams (PARCPARAMS) - output
Arc parameters.

Return Value

rc (BOOL) - returns
Success indicator.
TRUE - Successful completion
FALSE - Error occurred.

Remarks

Arc parameters are set by GpiSetArcParams. This function is invalid when the drawing mode (see GpiSetDrawingMode) is set to retain.

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_IN_RETAIN_MODE (0x208C)
An attempt was made to issue a function (for example, query) that is invalid when the actual drawing mode is not draw or draw-and-retain.
PMERR_INV_DC_TYPE (0x2060)
An invalid type parameter was specified with DevOpenDC, or a function was issued that is invalid for a OD_METAFILE_NOQUERY device context.

Example Code

This example uses GpiQueryArcParams to return the current arc parameters used to draw full, partial, and 3-point arcs. The example queries the arc parameters and assigns a variable to the P coefficient if the query succeeds.

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

BOOL      fSuccess;       /* success indicator */
HPS       hps;            /* Presentation-space handle */
ARCPARAMS parcpArcParams; /* Arc parameters */
LONG      lPcoefficient;  /* p coefficient of arc definition */

fSuccess = GpiQueryArcParams(hps, &parcpArcParams);

/* if successful, assign value of P coefficient */
if (fSuccess == TRUE)
  lPcoefficient = parcpArcParams.lP;

Related Functions