title: A portable function to create a bmp file from raw bytes?
body: <p>I have an array of raw bytes and I want to make a bmp file from those bytes. That is, I have to fill bitmap header structre and other things, then write down the bytes so I have a bmp file in the proper format.</p>
  
  <p>As I need this for some quick check only, I wonder if there is a portable method to do this - take raw bytes and save them as a bmp file. Any Windows version won't do as I'm writing that on Unix.</p>
  
  <p>Alternatively, I can save those bytes as any other image format - I only need to have a quick look at the resulting picture.  </p>