------------------
Dance with me......
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.
November 05, 1999 10:25 PM
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?
November 07, 1999 05:44 PM
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....
I don't really see what you want to have done with them, because it'squite obvious and easy to use....
------------------
Dance with me......
November 08, 1999 04:13 PM
Ok then CJ, could you post that code? Or mail it to pylorus69@hotmail.com
November 11, 1999 02:52 PM
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?
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. ~
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement