---
name: "XCreateRegion"
section: "3"
platform: "linux"
package: "libx11"
version: "1.8.14-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/XCreateRegion"
---

# XCreateRegion(3)

create or destroy regions

## NAME

XCreateRegion, XSetRegion, XDestroyRegion - create or destroy regions

## SYNTAX

Region XCreateRegion(void);

int XSetRegion(Display \**display*, GC *gc*, Region *r*);

int XDestroyRegion(Region *r*);

## ARGUMENTS

- *display*

  Specifies the connection to the X server.

- *gc*

  Specifies the GC.

- *r*

  Specifies the region.

## DESCRIPTION

The **XCreateRegion** function creates a new empty region.

The **XSetRegion** function sets the clip-mask in the GC to the specified region. The region is specified relative to the drawable's origin. The resulting GC clip origin is implementation-dependent. Once it is set in the GC, the region can be destroyed.

The **XDestroyRegion** function deallocates the storage associated with a specified region.

## SEE ALSO

[**XEmptyRegion**(3)](/XEmptyRegion/3.md), [**XIntersectRegion**(3)](/XIntersectRegion/3.md)\
 *Xlib - C Language X Interface*
