How are you guys reading in bitmaps?

Started by
4 comments, last by SGreth 23 years, 9 months ago
Hey there, just wondering what you guys are doing for reading in bitmaps? I''m trying to just skip the header info and read the color info right into an array (for OpenGL). I can''t seem to get it to line up correctly in the array though (what should be green ends up as red). Should be 00 FF 00 But is FF 00 00 in the array. Anybody have any code samples or web sites I can take a look at? Thanks a ton, ~S''Greth ERROR: Your beta-version of Life1.0 has expired. Please upgrade to the full version. All important social functions will be disabled from now on.
"The difference between insanity and genius is measured only by success."~Bruce Feirstein
Advertisement
Hi,

I think that bitmaps are saved dword aligned.


The Rock

-BAD software-

http://members.spree.com/entertainment/bad_software/
The Rock
Why are you using MadKeith's sig? Or maybe he's using yours?

Bitmaps are stored DWORD aligned (as glROCKS pointed out) and many of them are also stored upside down (why they do that I do not know though).

A good description of the bmp format can be found at Wotsit.

Do you have Tricks of the Windows Game Programming Gurus? The author has some code in there that will load a bitmap into a byte array (just got it working today btw ). If you want it, I can e-mail it to you, but there's no code to actually draw the bitmap (but that wasn't what you asked for ).

- Muzzafarath

Mad House Software
The Field Marshals

Edited by - Muzzafarath on July 11, 2000 10:36:06 AM

Edited by - Muzzafarath on July 11, 2000 10:38:01 AM
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
Hey that would be great if I could take a look at that code! I already took a look at wotsit (man I love that site). Sorry about re-posting that sig, but I saw it that other day and I thought it was the funniest damn sig I''ve seen in quite a while. Won''t post it again though Thanks a ton Muzzafarath!

~S''Greth
"The difference between insanity and genius is measured only by success."~Bruce Feirstein
I''ve sent the code to you.

- Muzzafarath

Mad House Software
The Field Marshals
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
Thanks a ton, my textures are all happy now Woohoo!
~S''Greth

Got Code?
"The difference between insanity and genius is measured only by success."~Bruce Feirstein

This topic is closed to new replies.

Advertisement