[Xcb] pixmap from file ?

Patrick patrick at spellingbeewinnars.org
Sun Aug 17 15:01:01 PDT 2014

Hi Everyone

I am moving along with my xcb studying and I have really lowered my 
goals of what I want to do with it, it's quite challenging for me.

I kinda sorta think I will understand how to set a pixmap to a window 
background and kinds sorta might be able to use copy_area as well but 
right now I just can't figure out how to get a pixmap off the disk and 
into the program.

I have been searching around and I found some demos. I have read through 
them and I have cut out this code:

     xcb_drawable_t        window_drawable, tmp, root_drawable;
     xcb_pixmap_t          surfaces[4], alpha_surface;

     root = xcb_setup_roots_iterator(xcb_get_setup(c)).data;
     root_drawable = root->root;

     alpha_surface = xcb_generate_id(conn);
     xcb_create_pixmap(conn, 8, alpha_surface, root_drawable, 600, 600);

I sort of understand how alpha_surface could be a full fledged pixmap 
now but I still have no clue how to make it an image from disk.

Could anyone point me to an example ? Is it possible to use fopen and 
just read in bytes and assign it to a newly created pixmap?

Thanks for reading-Patrick

More information about the Xcb mailing list