🎉 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!

GetBitmapBits

Started by
14 comments, last by GameDev.net 24 years, 7 months ago
I'm sorry, I don't use HBITMAP. But I know of many other ways to display bitmaps. if you want to see some source code either win32, mfc etc etc. I can email you that stuff.

------------------
Dance with me......

Advertisement
I know how to display bitmaps. All I want to know is how to write bits to a file and them read them later. It turns out, however, that I don't have to use GetBitmapBits, because the BITMAP structure contains the array of BYTES that I am looking for. I can get this structure by calling GetObject. Now, how do I use that array?
Dammit and now no-one is answering because they think it's answered
Well, first of all, GetBitmapBits is obsolete in Win32... You're supposed to use GetDIBits. GetDIBits has a cScanLines member that lets you specify how many scan lines to copy. Read the stuff in Help on how to treat a bitmap according to whether it's a bottom-up or a top-down DIB.

Once you have that info, go to http://www.codeguru.com/bitmap/bitmap_to_file.shtml and take a look at the sample code there. Pretty much everything you could want to know about bitmaps is on that site in the area of that particular article.

-fel

~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~
Well, if you would use my method to load those bitmaps, you would have allocated an array char *bits; with the height * width * 3. Which holds all the bytes. Now, you can just save them the same way as you loaded them.
I don't really see what you want to have done with them, because it'squite obvious and easy to use....

------------------
Dance with me......

Ok then CJ, could you post that code? Or mail it to pylorus69@hotmail.com
AHHH! this is driving me nuts. Ok, could someone please just give me some code to load a bitmap and write all the color data of that bitmap into a file? So theoretically i could load a bitmap, then take all the data of what each pixel is and write a new file type with it?
please help?
Check out the codeguru link I already gave you.

-fel

~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~
I send you 3 different ways of bitmaps writing / loading. Didn't it arrive or...?

------------------
Dance with me......

This topic is closed to new replies.

Advertisement