Drawing a Geometric (Wide) Line

The following figure is an example of how to draw a straight line, 10 units wide with rounded ends.

#define INCL_GPIPRIMITIVES
#include <os2.h>
void fncPATH01(void){
    POINTL ptl;
    HPS hps;

    GpiSetLineWidthGeom(hps, 10L);       /* Sets line width to ten              */
    GpiSetLineEnd(hps, LINEEND_ROUND);   /* Sets line end to round              */
    GpiBeginPath(hps, 1L);               /* Begins path                         */
    ptl.x = 7;
    ptl.y = 15;
    GpiMove(hps, &ptl);                  /* Sets current position               */
    ptl.x = 450;
    ptl.y = 15;
    GpiLine(hps, &ptl);                  /* Draws line                          */
    GpiEndPath(hps);                     /* Ends path                           */
    GpiStrokePath(hps, 1L, 0L);          /* Draws geometric line                */
} /* fncPATH01 */


[Back: Using Paths]
[Next: Drawing Filled Polygons]