XCreatePixmap()XCreatePixmap()Name
XCreatePixmap – create a pixmap.
Synopsis
Pixmap XCreatePixmap(display, drawable, width, height, depth)
Display *display;
Drawable drawable;
unsigned int width, height;
unsigned int depth;
Arguments
display Specifies a connection to an X server; returned from
XOpenDisplay().
drawable Specifies the drawable. May be an InputOnly window.
width Specify the width and height in pixels of the pixmap. The
height values must be non-zero.
depth Specifies the depth of the pixmap. The depth must be sup‐
ported by the screen of the specified drawable. (Use XList‐
Depths() if in doubt.)
Returns
The created Pixmap.
DescriptionXCreatePixmap() creates a pixmap resource and returns its pixmap ID.
The initial contents of the pixmap are undefined.
The server uses the drawable argument to determine which screen the
pixmap is stored on. The pixmap can only be used on this screen. The
pixmap can only be drawn drawn into with GCs of the same depth, and can
only be copied to drawables of the same depth, except in XCopyPlane().
A bitmap is a single-plane pixmap. There is no separate bitmap type in
X Version 11.
Pixmaps should be considered a precious resource, since many servers
have limits on the amount of off-screen memory available.
If you are creating a pixmap for use in XCreatePixmapCursor(), specify
depth = 1, fg = 1, and bg = 0.
For more information, see Volume One, Chapter 6, Drawing Graphics and
Text.
Errors
BadAlloc
BadDrawable
BadValue width or height is 0.
depth is not supported on screen.
See AlsoXCreateBitmapFromData(), XCreatePixmapFromBitmapData(), XFreePixmap(),
XListDepths(), XListPixmapFormat, XQueryBestCursor(), XQueryBestSize(),
XQueryBestStipple(), XQueryBestTile(), XReadBitmapFile(), XSetTile(),
XSetWindowBackgroundPixmap(), XSetWindowBorderPixmap(), XWriteBitmap‐
File().
Xlib - Pixmaps and Tiles XCreatePixmap()