How to read/write a bmp file?

I want to write a code which make a image .bmp and to choose pixels colors from a file named pixels.in.
I saw format file on wikipedia but I don't get how it work? Can someone give me full code please or explain how to write bitheader bitinfo bitarrays to file?
Topic archived. No new replies allowed.