When drawing a circle, all the transformations between the world, model, page, and device spaces must maintain square units. This means that your application should select metric, English, or arbitrary page units instead of pels. On most devices, pels are rectangular, but not necessarily square. This also means that the Sx and Sy scaling factors should be equal. If the transformations maintain square units and the arc parameters are set to their default values, GpiFullArc produces a circle.
In the example shown in the following figure, if the page units are PU_LOENGLISH and the default transformations are set, a circle with a radius of 1/2 inch is drawn.
#define INCL_GPIPRIMITIVES #include <os2.h> HPS hps; /* Presentation-space handle */ MRESULT EXPENTRY wpClient (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2){ ARCPARAMS arcp; /* Structure for arc parameters */ POINTL ptlPos; /* Structure for current position */ FIXED fxMult; /* Multiplier for circle */ arcp.lP = 1; arcp.lQ = 1; arcp.lR = 0; arcp.lS = 0; GpiSetArcParams(hps, &arcp); /* Sets parameters to default */ ptlPos.x = 100; /* 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 */
The second argument to GpiFullArc DRO_OUTLINE, specifies that the operating system should draw only the outline of the circle-rather than filling the interior with the current fill pattern. The third argument, fxMult, specifies that the operating system should multiply the size of the circle by 50 units. Because the page units are PU_LOENGLISH and the default transformations are set, 50 units is equivalent to 1/2 inch.