To create a clip region, first determine its size and shape (in device coordinates). Load the coordinates for the rectangles that define the clip region into an array of RECTL structures. Then create the region and set it to a clip region with GpiCreateRegion and GpiSetClipRegion respectively.
The following figure shows how to create a clip region.
#include <os2.h> void fncCLIP02(void){ HPS hps; HRGN hrgn; RECTL arcl[3]; . . /* Load array of RECTL structures with coordinates. */ . hrgn = GpiCreateRegion(hps, sizeof(arcl) / sizeof(RECTL), arcl); GpiSetClipRegion(hps, hrgn, NULL); } /* fncCLIP02 */