---
name: "xcb_shm_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_shm_create_pixmap"
---

# xcb\_shm\_create\_pixmap(3)

Create a pixmap backed by shared memory.

## NAME

xcb\_shm\_create\_pixmap - Create a pixmap backed by shared memory.

## SYNOPSIS

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

### Request function

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

## REQUEST ARGUMENTS

- *conn*

  The XCB connection to X11.

- *pid*

  A pixmap ID created with xcb\_generate\_id().

- *drawable*

  The drawable to create the pixmap in.

- *width*

  The width of the pixmap to create.  Must be nonzero, or a Value error results.

- *height*

  The height of the pixmap to create.  Must be nonzero, or a Value error results.

- *depth*

  The depth of the pixmap to create.  Must be nonzero, or a Value error results.

- *shmseg*

  The shared memory segment to use to create the pixmap.

- *offset*

  The offset in the segment to create the pixmap at.

## DESCRIPTION

Create a pixmap backed by shared memory.  Writes to the shared memory will be reflected in the contents of the pixmap, and writes to the pixmap will be reflected in the contents of the shared memory.

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

## ERRORS

This request does never generate any errors.

## SEE ALSO

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

## AUTHOR

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