---
name: "xcb_create_pixmap"
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_create_pixmap"
---

# xcb\_create\_pixmap(3)

Creates a pixmap

## NAME

xcb\_create\_pixmap - Creates a pixmap

## SYNOPSIS

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

### Request function

xcb\_void\_cookie\_t **xcb\_create\_pixmap**(xcb\_connection\_t \**conn*, uint8\_t *depth*, xcb\_pixmap\_t *pid*, xcb\_drawable\_t *drawable*, uint16\_t *width*, uint16\_t *height*);\

## REQUEST ARGUMENTS

- *conn*

  The XCB connection to X11.

- *depth*

  TODO

- *pid*

  The ID with which you will refer to the new pixmap, created by *xcb\_generate\_id*.

- *drawable*

  Drawable to get the screen from.

- *width*

  The width of the new pixmap.

- *height*

  The height of the new pixmap.

## DESCRIPTION

Creates a pixmap. The pixmap can only be used on the same screen as *drawable* is on and only with drawables of the same *depth*.

## 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\_create\_pixmap\_checked*. See **[xcb-requests(3)](/xcb-requests/3.md)** for details.

## ERRORS

- *xcb\_alloc\_error\_t*

  The X server could not allocate the requested resources (no memory?).

- *xcb\_drawable\_error\_t*

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

- *xcb\_value\_error\_t*

  TODO: reasons?

## SEE ALSO

[**xcb-requests**(3)](/xcb-requests/3.md), **xcb\_generate\_id**(3)

## AUTHOR

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