Jump to content

GpiFullArc: Difference between revisions

From EDM2
Created page with "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_..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 2: Line 2:


==Syntax==
==Syntax==
  GpiFullArc(hps, lControl, fxMultiplier);
  GpiFullArc(hps, lControl, fxMultiplier)
 


==Parameters==
==Parameters==
;hps (HPS) - input
;hps (HPS) - input:Presentation-space handle.
:Presentation-space handle.  
;lControl (LONG) - input:Interior and outline control.
 
;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:
: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_FILL
::DRO_OUTLINE - Draw outline
::Fill interior  
::DRO_OUTLINEFILL - Draw outline and fill interior.
:;DRO_OUTLINE
;fxMultiplier (FIXED) - input:Multiplier.
::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.
: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.
:The value must not be negative.


==Returns==
==Returns==
;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.
 


==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_ARC_CONTROL (0x2040):An invalid control parameter was specified with GpiFullArc.
:An attempt was made to access the presentation space from more than one thread simultaneously.  
;PMERR_INV_MULTIPLIER (0x20A7):An invalid multiplier parameter was specified with GpiPartialArc or GpiFullArc.
;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==
==Remarks==
Line 58: Line 38:
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 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).  
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==
==Example Code==
<pre>
#define INCL_GPIPRIMITIVES /* Or use INCL_GPI, INCL_PM, */
#include <os2.h>
HPS      hps;          /*  Presentation-space handle. */
LONG    lControl;      /*  Interior and outline control. */
FIXED    fxMultiplier;  /*  Multiplier. */
LONG    lHits;        /*  Correlation and error indicators. */
lHits = GpiFullArc(hps, lControl, fxMultiplier);
</pre>
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.
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.
<pre>
<pre>
Line 111: Line 78:
Element Type: OCODE_GCFARC
Element Type: OCODE_GCFARC


;Order: Begin Area
;Order: Begin Area:This order is generated only if lControl is DRO_FILL or DRO_OUTLINEFILL. Order: Full Arc at Current Position
: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.
;Order: End Area
:This order is generated only if lControl is DRO_FILL or DRO_OUTLINEFILL.  
 


[[Category:Gpi]]
[[Category:Gpi]]

Latest revision as of 11:18, 3 April 2025

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.