Loading BMP's - Data Alignment ?
Is there any sort of alignment with the actual bitmap data in a 24 bit .bmp file? I''m working on a routine that loads a .bmp file of dynamic size, and I''m getting big-time shearing on images that have odd (as far as I can tell) pixel widths. I get the feeling it has something to do with data alignment in individual rows of pixels, but I''m very inexperienced with this sort of thing. Any feedback would be greatly appreciated. You don''t have to write the whole routine or anything, I''m just wondering how the bytes are aligned.
Thanks a lot,
-Lutrosis
-Lutrosis#define WHOOPS 0class DogClass {public: CDog() { printf("Ruff!"); } Run() { printf("Run!"); } Crash() { printf("%d",100/WOOPS); }};DogClass CDog;CDog.Run();CDog.Crash();
Scans in bitmaps are padded to end on DWORD boundaries. That is if you have an number of pixels in your width that isn''t a multiple of 4, you''ll have some padding at the end of every line to bring it up to a multiple of 4 bytes.
Aha! I knew it had to be something like that. Thanks a lot for the info, it should be easy to fix the problem now. Now I can finally move on to more important (and enjoyable) things =]
-Lutrosis
-Lutrosis
-Lutrosis#define WHOOPS 0class DogClass {public: CDog() { printf("Ruff!"); } Run() { printf("Run!"); } Crash() { printf("%d",100/WOOPS); }};DogClass CDog;CDog.Run();CDog.Crash();
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement