Creating a .bmp file

Soldato
Joined
22 Oct 2005
Posts
2,884
Location
Moving...
How do I physically create a .bmp file? I've got all the information required to fill the bmp file header, DIB header and the actual image data in a 2D array. So how do I actually create an image file rather than just some C source code file if you see what I mean?

Sorry if this is a silly question:o

Thanks.
 
Hi,

What language are you using?

If you have all the data you just need to use the output to file functions of whatever language.
 
Hi,

What language are you using?

If you have all the data you just need to use the output to file functions of whatever language.


I'm using straight C. Do you know any output to file functions that will work with a .bmp (or any other picture format for that matter)? All I can find relates to outputting to a text file. I know that if you specify a text file to write to that doesn't exist then it creates one automatically. Is there a similar way you can do this with an image file?

Thanks again.

**SOLVED** found out that you can write it just like you do when writing to a text file but you just need to use the 2 structures BITMAPINFOHEADER and BITMAPFILEHEADER.
Cheers.
 
Last edited:
Back
Top Bottom