Regions are sets of pixels. They are held by the client program and are often used to create masks etc. These are created by
Region XCreateRegion();which creates an empty region. This can be assigned to using
Region XPolygonRegion(points,n,fill_rule) XPoint points[];and destroyed by
XDestroyRegion(r)To clear a region, destroy and recreate it. To find the smallest enclosing rectangle use
XClipBox(r,rect) XRectangle rect /*RETURN*/To use a region as a GC's mask, use
XSetRegion(display,gc,r)To move a region use
XOffsetRegion(r,dx,dy)To change the size of a region use
XShrinkRegion(r,dx,dy) /* if dx or dy <0 then the shrink becomes expand*/Other operations are:-
XIntersectRegion(sra,srb,dr) Region dr; /*RETURN*/ XUnionRegion(sra,srb,dr) Region dr; /*RETURN*/ XUnionRectWithRegion(rect, src_region, dest_region) Rectangle *rect; XSubtractRegion(sra,srb,dr) Region dr; /*RETURN (union - intersection)*/ XXorRegion(sra,srb,dr) Region dr; /*RETURN*/ int XEmptyRegion(r) /* is the region null ? */ int XEqualRegion(r1,r2) int XPointInRegion(r,x,y) int XRectInRegion(r,x,y,width,height)