🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Editing, creating, and saving files

Started by
2 comments, last by C++ Freak 24 years, 5 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
Advertisement
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.
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