gpi12.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
GpiSetArcParams (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_GPIPRIMITIVES
 
BOOL GpiSetArcParams(hps, parcp)
HPS hps;             /* presentation-space handle               */
PARCPARAMS parcp;    /* address of structure for arc parameters */
 
The GpiSetArcParams function sets the current arc parameters. The arc
parameters define the shape and orientation of the ellipse used by the
GpiPointArc, GpiFullArc, and GpiPartialArc functions to construct arcs.
 
The arc parameters define a four-element transformation that maps the unit
circle to the ellipse. The transformation has the form:
 
          x' = lP * x + lR * y
          y' = lS * x + lQ * y
 
In the transformation, lP, lR, lS, and lQ are the fields of the structure
pointed to by the parcp parameter. The lP and lQ fields determine the width
and height of ellipse, and the lS and lR fields determine the shear of the
ellipse.
 
The fields also determine the direction of drawing for arcs drawn using the
GpiFullArc and GpiPartialArc functions. If lP * lQ is greater than lR * lS,
the direction is counterclockwise. If lP * lQ is less than lR * lS, the
direction is clockwise. If lP * lQ is equal to lR * lS, a straight line is
drawn.
 
If the attribute mode is AM_PRESERVE, the function saves the previous arc
parameters on the attribute stack when it sets the new parameters. The
previous arc parameters can be retrieved by using the GpiPop function.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
hps        Identifies the presentation space.
 
parcp      Points to an ARCPARAMS structure that contains the arc
           parameters.
 
Return Value
 
The return value is GPI_OK if the function is successful or GPI_ERROR if an
error occurred.
 
Errors
 
Use the WinGetLastError function to retrieve the error value, which may be
one of the following:
 
     PMERR_INV_COORDINATE
     PMERR_INV_HPS
     PMERR_PS_BUSY
 
Comments
 
Although the arc parameters define the shape and orientation of arcs drawn
by the GpiPointArc, GpiFullArc, and GpiPartialArc functions, the functions
define the center point and the size of each arc. The GpiFullArc and
GpiPartialArc functions use an explicit center point and a multiplier to
scale the ellipse to a desired size. The GpiPointArc function computes the
center point and size of the final ellipse so that it fits the given
points.
 
Orthogonal transformation provides the most accurate arcs. A transformation
is orthogonal if lP * lR plus lS * lQ equals zero. By default, the arc
parameters are as follows:
 
          lP = 1     lR = 0
          lS = 0     lQ = 1
 
These values produce a unit circle.
 
Arc-parameter transformation takes place in world coordinates. Any other
transformations in force will change the shape of the figure accordingly.
 
See Also
 
GpiFullArc, GpiPartialArc, GpiPointArc, GpiQueryArcParams, WinGetLastError,
ARCPARAMS