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 a Drawable argument does not name a defined Window or Pixmap.
  • BadPixmap β€” A value for a Pixmap argument does not name a defined Pixmap.
  • 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 🌈


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