Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Guest Anonymous Poster

GetBitmapBits

This topic is 6819 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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......

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
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?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Dammit and now no-one is answering because they think it's answered

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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......

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Ok then CJ, could you post that code? Or mail it to pylorus69@hotmail.com

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
please help?

Share this post


Link to post
Share on other sites
I send you 3 different ways of bitmaps writing / loading. Didn't it arrive or...?

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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!