Painting a Region

GpiPaintRegion fills a region with the current fill pattern, using the colors and mix mode that appear in the current AREABUNDLE structure. GpiFrameRegion draws a frame around a region by tracing the perimeter of the region with a rectangle of a specified size. The following figure shows how to change the fill-pattern color to green, paint a region, and draw a frame around the region.

    SIZEL sizl;                        /* Structure for size of frame */
    HPS  hps;                          /* Presentation-space handle   */
    HRGN hrgn;                         /* Region handle               */

    GpiSetColor(hps, CLR_DARKPINK);
    GpiPaintRegion(hps, hrgn);         /* Paint region dark pink      */
    GpiSetColor(hps, CLR_BLACK);
    sizl.cx = 5;
    sizl.cy = 5;
    GpiFrameRegion(hps, hrgn, &sizl);   /* 5-by-5 black frame         */


[Back: Offsetting a Region]
[Next: Locating a Point with Respect to a Region]