Creating a Triangular Clip Path

The following figure shows an example of how to create a triangular clip path and then write text into it.

#define INCL_GPIPATHS
#include <os2.h>
void fncPATH04(void){
    POINTL ptlStart;
    HPS hps;
    LONG i;

    POINTL aptl[4] = {             /* Array of points for triangle     */
           35,  45,
          100, 100,
          200,  45,
           35,  45 };

    GpiBeginPath(hps, 1L);         /* Begins path bracket              */
    GpiMove(hps, aptl);            /* Sets current position            */
    GpiPolyLine(hps, 4L, aptl);    /* Plots points for triangle        */
    GpiEndPath(hps)                /* Ends path bracket                */

    GpiSetClipPath(hps, 1L, SCP_ALTERNATE | SCP_AND);

    /* Write a block of text.                                          */

    ptlStart.x = 50;
    for (i = 50L; i < 110L; i += 10L) {
        ptlStart.y = i;
        GpiCharStringAt(hps, &ptlStart, 18L, "String of text!");
    } /* for */
} /* fncPATH04 */


[Back: Drawing Outline Text]
[Next: Regions]