create .bmp file

Hello there,

I now have a file with X, Y, Z and Intensity (0-1) of all the pixels. I want to create a .bmp file (grayscale) with this information in C++. Can anyone tell me how to do it?

I really appreciate your help.

There are two ways to do this.

a) Study the BMP file format and then implement your code in straight C++ without any helper libraries:

http://en.wikipedia.org/wiki/BMP_file_format
http://stackoverflow.com/questions/2654480/writing-bmp-image-in-pure-c-c-without-other-libraries

b) Use a helper library that does most of the work for you. The downside is that you'll have to learn a different way to do the same thing, if you suddenly decide to use another library.

http://bitmap.codeplex.com/
http://easybmp.sourceforge.net/
http://www.sfml-dev.org/index.php
http://www.sfml-dev.org/documentation/2.0/classsf_1_1Image.php
Topic archived. No new replies allowed.