------------------
Dance with me......
🎉 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
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.
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?
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
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....
I don't really see what you want to have done with them, because it'squite obvious and easy to use....
------------------
Dance with me......
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?
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
Popular Topics
Advertisement