Click to See Complete Forum and Search --> : How to read and write CBitmaps to a file


MugWump
June 3rd, 2004, 04:13 PM
I have a VC++ 6 program which has an array of CBitmap objects. I want to write the bitmaps (as well as a count of how many there are) to a file so that I can read them back in when I run the program at a later time. I have discovered that CBitmaps are not serializable in MFC so am unable to use that logic. There has been a lot of discussion regarding this problem on other message boards, but so far I have been unable to find any specific details regarding how to solve it.

If someone would be so kind as to give me some specific directions on how to do this (or better yet some code!), I would really appreciate it.

Thanks!

Marc G
June 5th, 2004, 03:57 AM
Perhaps you can use GetBitmapBits and write those bits to file together with the info you get from GetObject.