Advertisement

Editing, creating, and saving files

Started by January 11, 2000 04:12 PM
2 comments, last by C++ Freak 24 years, 11 months ago
I want to make a bitmap editor for my game. How do you create, edit, and save files .bmp files? Thanks for the help. Edited by - C++ Freak on 1/11/00 4:21:57 PM
Visit http://members.xoom.com/ivanickgames
you can check out www.wotsit.com for the bmp file format. then u just write it as a regular file in C. of course, depending on the complexity of your editor.. you have ur work cut out for you. there are plenty of helper functions out there for loading and maybe even saving bmps.
Advertisement
the basic structure of a bitmap is:

BITMAPFILEHEADER
BITMAPINFOHEADER
PALETTEENTRY[256] <- only in 8 bit pictures
filedata

look it up in the platform sdk docs
Basically it comes down to filling out the data structures mentioned by Staffan and then using either C methodes like fwrite, C++''s ofstream::write, or Windows API to dump the unformated information to a file.

If you want some example code just e-mail me.

This topic is closed to new replies.

Advertisement