XCreatePixmap(3)
β¨ NAME β¨
okay so XCreatePixmap(3) is from the XLIB FUNCTIONS manual, and this page is all about XCreatePixmap, XFreePixmap β create or destroy pixmaps π
π¦ SYNTAX π¦
Pixmap XCreatePixmap(Display *display, Drawable d, unsigned int width,
unsigned int height, unsigned int depth);
int XFreePixmap(Display *display, Pixmap pixmap);
Exact signatures, bestie β copy them like your life depends on it π
πΈ ARGUMENTS πΈ
dβ Specifies which screen the pixmap is created on. Main-character screen choice energy β¨depthβ Specifies the depth of the pixmap. Yes, depth matters, no cap π«Άdisplayβ Specifies the connection to the X server. This is the group chat link to the server, basically πpixmapβ Specifies the pixmap. That's the whole vibe right there.width,heightβ Specify the width and height, which define the dimensions of the pixmap. Gotta give her measurements, obviously π
π DESCRIPTION π
XCreatePixmap creates a pixmap of the width, height, and depth you specified and returns a pixmap ID that identifies it. Iconic behavior, honestly π
It is valid to pass an InputOnly window to the drawable argument. Yes bestie, that's allowed β noted and filed away π
The width and height arguments must be nonzero, or a BadValue error results. Zero is not cute here, it's an error. π«
The depth argument must be one of the depths supported by the screen of the specified drawable, or a BadValue error results. So check your screen's depth menu first, bestie.
The server uses the specified drawable to determine on which screen to create the pixmap. The pixmap can be used only on this screen and only with other drawables of the same depth (see XCopyPlane for an exception to this rule). So she's loyal to her screen and her depth β XCopyPlane is literally the one exception, iykyk π
The initial contents of the pixmap are undefined. Literally undefined, bestie β do not assume they're zeros or sparkles. π«Ά
XCreatePixmap can generate BadAlloc, BadDrawable, and BadValue errors.
XFreePixmap first deletes the association between the pixmap ID and the pixmap. Then, the X server frees the pixmap storage when there are no references to it. The pixmap should never be referenced again. Never ever β like, do not bring her up in the group chat after this π
XFreePixmap can generate a BadPixmap error.
π DIAGNOSTICS π
BadAllocβ The server failed to allocate the requested resource or server memory.BadDrawableβ A value for aDrawableargument does not name a definedWindoworPixmap.BadPixmapβ A value for aPixmapargument does not name a definedPixmap.BadValueβ Some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argument, the full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can generate this error.
π SEE ALSO π
XCopyArea(3)Xlib - C Language X Interface
okay bye bestie π«Ά source/version tea: X Version 11, libX11 1.8.14; the footer date isn't shown on this page, and the footer title is XCreatePixmap(3). No invented dates, periodt π
β¨
π¦ where this page comes from
- alpine 3.24: libx11-doc 1.8.14-r0 Β· X11
- arch rolling: libx11 1.8.14-1 Β· MIT AND X11
- nixos 26.05: libx11 1.8.14
- nixpkgs unstable: libx11 1.8.14
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms