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
displaySpecifies a connection to an X server; returned from XOpenDisplay().
drawableSpecifies the drawable. May be an InputOnly window.
width
heightSpecify the width and height in pixels of the pixmap. The values must be nonzero.
depthSpecifies the depth of the pixmap. The depth must be supported by the screen of the specified drawable. (Use XListDepths() if in doubt.)
Description
XCreatePixmap() 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
BadValuewidth or height is 0.
depth is not supported on screen.
See Also
XCreateBitmapFromData(), XCreatePixmapFromBitmapData(), XFreePixmap(), XListDepths(), XListPixmapFormat, XQueryBestCursor(), XQueryBestSize(), XQueryBestStipple(), XQueryBestTile(), XReadBitmapFile(), XSetTile(), XSetWindowBackgroundPixmap(), XSetWindowBorderPixmap(), XWriteBitmapFile().
Copyright O’Reilly & Assoc. —