I've read messages here that referred to the fileformat.info
website as a source of information on the BMP format. Please be aware that the information on BMP given at that site is various times either misleading or just plain wrong, not to mention being drastically overcomplicated. It's not surprising that someone would be confused if they were relying on that site. The original book it's based on came out in 1994, and the 2nd edition in early 1996, so it's likely this information was based on beta code and/or documentation, or just plain guesswork.
The biggest problem is the fact that their definition of the "BMP Version 3 (Windows NT)" and "BMP Version 4" formats, including especially the definition of the WINNTBITMAPHEADER and WIN4XBITMAPHEADER structures, seems to be a bastardized reference to Microsoft's BITMAPV4HEADER and BITMAPV5HEADER structures, and is simply not correct.Any application that creates BMP files based on the WIN4XBITMAPHEADER and WINNTBITMAPHEADER structures defined on the fileformat.info website, or the original book, is not creating VALID files.
By "valid" I mean in keeping with Microsoft's documentation
. Note that "invalid" BMP files will still work perfectly fine in many applications, if not MOST, regardless of the platform, if the only problem is a non-standard header. As long as the first 40 bytes that match the BITMAPINFOHEADER structure are used properly, most applications will simply ignore the extra fields. Even those applications which DO support the extra information in the BITMAPV4HEADER and BITMAPV5HEADER structures should work as long as they're properly
checking the size field in the header.
For maximum compatibility, applications creating BMP files should use the 40-byte BITMAPINFOHEADER
structure. The BITMAPV4HEADER
structures are VERY RARELY
used, and rarely properly. Anybody writing code to create BMP files should probably avoid using them if at all possible. In fact, from what I can see, using them seems to be the #1 cause of problems with BMP files created on non-Windows platforms.
Microsoft's definition of the .BMP format is given at: http://msdn.microsoft.com/en-us/library/dd183391(VS.85).aspx