Reading bitmaps in C++
Posted on 2003-03-03
Okay, so I have looked around, read a few tutorials, and discovered ways of reading bitmap files into a DOS app, myself (no I don't want to use MFC or SDL or Windows functions - I'm talking pure C++)
Only problem is none of them work.
My program will load the first member variable of the Bitmap Header struct properly, but after that it gets messed up. I have been messing with it for quite some time but haven't yet been able to figure out whats wrong. I have lots of details I can post if you need them - but all I really want is working code to load the bitmap into memory, or else an eplanation of how C++ loads and saves classes using fstream.write and fstream.read, and how to make it work with the bitmap file.
I am using Windows XP, and have compiled the code under both MSVC++ 6.0 and DJGPP, with the same results.