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

# xcb\_copy\_area(3)

copy areas

## NAME

xcb\_copy\_area - copy areas

## SYNOPSIS

**#include \<xcb/xproto.h\>**

### Request function

xcb\_void\_cookie\_t **xcb\_copy\_area**(xcb\_connection\_t \**conn*, xcb\_drawable\_t *src\_drawable*, xcb\_drawable\_t *dst\_drawable*, xcb\_gcontext\_t *gc*, int16\_t *src\_x*, int16\_t *src\_y*, int16\_t *dst\_x*, int16\_t *dst\_y*, uint16\_t *width*, uint16\_t *height*);\

## REQUEST ARGUMENTS

- *conn*

  The XCB connection to X11.

- *src\_drawable*

  The source drawable (Window or Pixmap).

- *dst\_drawable*

  The destination drawable (Window or Pixmap).

- *gc*

  The graphics context to use.

- *src\_x*

  The source X coordinate.

- *src\_y*

  The source Y coordinate.

- *dst\_x*

  The destination X coordinate.

- *dst\_y*

  The destination Y coordinate.

- *width*

  The width of the area to copy (in pixels).

- *height*

  The height of the area to copy (in pixels).

## DESCRIPTION

Copies the specified rectangle from *src\_drawable* to *dst\_drawable*.

## RETURN VALUE

Returns an *xcb\_void\_cookie\_t*. Errors (if any) have to be handled in the event loop.

If you want to handle errors directly with *xcb\_request\_check* instead, use *xcb\_copy\_area\_checked*. See **[xcb-requests(3)](/xcb-requests/3.md)** for details.

## ERRORS

- *xcb\_drawable\_error\_t*

  The specified *drawable* (Window or Pixmap) does not exist.

- *xcb\_g\_context\_error\_t*

  The specified graphics context does not exist.

- *xcb\_match\_error\_t*

  *src\_drawable* has a different root or depth than *dst\_drawable*.

## SEE ALSO

[**xcb-requests**(3)](/xcb-requests/3.md)

## AUTHOR

Generated from xproto.xml. Contact xcb@lists.freedesktop.org for corrections and improvements.
