To combine two regions:
The following figure shows how to combine two regions by using the OR operation:
#define INCL_GPIREGIONS#include <os2.h>
void fncREGN02(void){
HPS hps;
HRGN hrgn1, hrgn2, hrgn3; /* Region handles */
RECTL rcl1, rcl2;
rcl1.xLeft = 50; rcl1.yBottom = 100;
rcl1.xRight = 200; rcl1.yTop = 175;
hrgn1 = GpiCreateRegion(hps, 1L, &rcl1); /* First source region */
rcl2.xLeft = 125; rcl2.yBottom = 150;
rcl2.xRight = 225; rcl2.yTop = 200;
hrgn2 = GpiCreateRegion(hps, 1L, &rcl2); /* Second source region */
hrgn3 = GpiCreateRegion(hps, 0L, (PRECTL) NULL); /* Destination region */
/* Combine the regions. */
GpiCombineRegion(hps, hrgn3, hrgn1, hrgn2, CRGN_OR);
} /* fncREGN02 */