Apr 17, 2002 #1 dima2 Programmer Jan 20, 2002 85 LB is there a way to create a CBitmap object form a buffer containing data in bmp format?
Apr 17, 2002 #2 williamu Programmer Apr 8, 2002 494 GB Yep, You can use the CreateBitmapIndirect() to do this. It takes a * to a BITMAP struct that contains the information about the bitmap. HTH. William Software Engineer ICQ No. 56047340 Upvote 0 Downvote
Yep, You can use the CreateBitmapIndirect() to do this. It takes a * to a BITMAP struct that contains the information about the bitmap. HTH. William Software Engineer ICQ No. 56047340
Apr 17, 2002 #3 Zyrenthian Programmer Mar 30, 2001 1,440 US ya, you are going to want to read in the BITMAPFILEHEADER bmf; BITMAPINFOHEADER bmi; and from those you can determine the size of the buffer for the acutal bitmap data BYTE *bmpBits = new BYTE[bmi.biWidth*bmi.biHeight*bmi.biBitCount/8]; then read the rest of the buffer into that and that is your bitmap bits which the BITMAP struct will want when you create indirect. Also, other members of BITMAP will need to be set. Matt Upvote 0 Downvote
ya, you are going to want to read in the BITMAPFILEHEADER bmf; BITMAPINFOHEADER bmi; and from those you can determine the size of the buffer for the acutal bitmap data BYTE *bmpBits = new BYTE[bmi.biWidth*bmi.biHeight*bmi.biBitCount/8]; then read the rest of the buffer into that and that is your bitmap bits which the BITMAP struct will want when you create indirect. Also, other members of BITMAP will need to be set. Matt