If you set the world, model, page, and device transformations so that they maintain square units, you can use the arc parameters to transform the shape of the unit circle to an ellipse, and draw this with GpiFullArc. The example in the following figure alters the arc parameter, p, by doubling its value, making the ellipse twice as wide horizontally as it is vertically.
In the example shown in the following figure, if the page units are PU_LOENGLISH and the default transformations are set, an ellipse with a 2-inch major axis (parallel to the x-axis) and a 1-inch minor axis (parallel to the y-axis) is drawn.
#define INCL_GPIPRIMITIVES #include <os2.h> HPS hps; /* Presentation-space handle */ MRESULT EXPENTRY wpClient (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2){ POINTL ptlPos; /* Structure for current position */ FIXED fxMult; /* Multiplier for ellipse */ ARCPARAMS arcp; /* Structure for arc parameters */ arcp.lP = 2; arcp.lQ = 1; arcp.lR = 0; arcp.lS = 0; GpiSetArcParams(hps, &arcp); /* Sets parameters to default */ ptlPos.x = 200; /* Loads x-coordinate */ ptlPos.y = 100; /* Loads y-coordinate */ GpiMove(hps, &ptlPos); /* Sets current position */ fxMult = MAKEFIXED(50, 0); /* Sets multiplier */ GpiFullArc(hps, DRO_OUTLINE, fxMult); /* Draws circle */ } /* wpClient */
Because the arc-parameter fields, lP and lQ, are set to 2 and 1, the operating system creates an ellipse with a major axis that is twice as long as the minor axis.