Jump to content

GpiFullArc

From EDM2
Revision as of 11:18, 3 April 2025 by Ak120 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function creates a full arc with its center at the current position.

Syntax

GpiFullArc(hps, lControl, fxMultiplier)

Parameters

hps (HPS) - input
Presentation-space handle.
lControl (LONG) - input
Interior and outline control.
Specifies whether the interior of the full arc should be filled, and whether the outline should be drawn. This parameter can have one of the following values:
DRO_FILL - Fill interior
DRO_OUTLINE - Draw outline
DRO_OUTLINEFILL - Draw outline and fill interior.
fxMultiplier (FIXED) - input
Multiplier.
This determines the size of the arc, in relation to an arc with the current arc parameters. The implementation limit of the multiplier is 255.
The value must not be negative.

Returns

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_INV_ARC_CONTROL (0x2040)
An invalid control parameter was specified with GpiFullArc.
PMERR_INV_MULTIPLIER (0x20A7)
An invalid multiplier parameter was specified with GpiPartialArc or GpiFullArc.

Remarks

The current position is not changed.

The arc parameters determine whether the full arc is drawn clockwise or counterclockwise.

Either the outline of the full arc, or its interior, or both, can be drawn.

If this function appears within an area or path definition, it generates a complete closed figure (DRO_OUTLINE must be specified). It must not occur within any other figure definition.

If correlation is in force, a hit always results if the pick aperture intersects the full arc boundary. However, if the pick aperture lies wholly within the figure, a hit only occurs if the interior is being drawn (DRO_FILL or DRO_OUTLINEFILL).

Example Code

This example uses GpiFullArc to draw five concentric circles. The arc parameters are set before drawing the arc. Only the outline is drawn for the arc.

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

HPS hps;                /* presentation space handle            */
SHORT i;                /* loop variable                        */
ARCPARAMS arcp = { 1, 1, 0, 0 }; /* arc parameters structure    */

GpiSetArcParams(hps, &arcp);

for (i = 5; i > 0; i--)
    GpiFullArc(hps,          /* presentation-space handle       */
        DRO_OUTLINE,         /* outline                         */
        MAKEFIXED(i, 0));    /* converts integer to fixed point */

Related Functions

  • GpiPartialArc
  • GpiPointArc
  • GpiPop
  • GpiSetArcParams
  • GpiSetAttrMode
  • GpiSetAttrs
  • GpiSetBackColor
  • GpiSetBackMix
  • GpiSetColor
  • GpiSetCurrentPosition
  • GpiSetDefArcParams
  • GpiSetDefAttrs
  • GpiSetLineType
  • GpiSetLineWidth
  • GpiSetMix

Graphic Elements and Orders

Element Type: OCODE_GCFARC

Order
Begin Area:This order is generated only if lControl is DRO_FILL or DRO_OUTLINEFILL. Order: Full Arc at Current Position
Order
End Area:This order is generated only if lControl is DRO_FILL or DRO_OUTLINEFILL.