Create a Pixmap with
Pixmap XCreatePixmap(display, d, width, height, depth)
Display *display;
Drawable d;
Creating a graphics context for Pixmap
GC XCreateGC(display, d, valuemask, values)
Draw an XImage in Pixmap
XPutImage(display, pixmap, gc, image, src_x, src_y, dest_x, dest_y, width, height)
Drawable d;
XImage *image;
Finally, set Pixmap as background background
XSetWindowBackgroundPixmap(display, w, background_pixmap)
Display *display;
Window w;
Pixmap background_pixmap;
Then release all resources that you no longer need.
source
share