title: C++ (LINUX) set X11 window background with DevIL
body: <p>I am trying to set a background image for one of my windows created with Xlib.
  I would like the image to be a JPEG or PNG. I downloaded DevIL (which I prefer to use because it supports a lot of formats).</p>
  
  <p>So, my questions, is, how do I do it? I can't find any specific tutorial or help.<br>
  I understand how I can use DevIL to load an image into a stream, but how do I put that on the window? I found an answer here: <a href="https://stackoverflow.com/questions/6384987/load-image-onto-a-window-using-xlib">Load image onto a window using xlib</a> but I don't know how and which function should receive the image bytes. 
  As I also understand, I should have a XImage that would hold all the image, and which I would use with XPutImage. What I don't understand is how do I send the image's bytes from DevIL to XImage.</p>
  
  <p>Does somebody know any helpful page or maybe some clues about how I should do it?<br>
  Thanks!</p>