by Digby » Sep 4, 2001 @ 1:05pm
What I ended up doing was writing special case code that if bmBits were NULL:<br><br>- Create a temp DIB section of the same dimensions and color depth as the source bitmap.<br><br>- Create a memory DC via CreateCompatibleDC and select the source bitmap into the DC.<br><br>- Create another memory DC via CreateCompatibleDC and select the DIB section's HBITMAP into the DC.<br><br>- Use BitBlt and copy the source to the DIB section bitmap.<br><br>Since the DIB section has a pointer to the bits, you don't need to call GetObject at this point to retrieve the bits.<br><br>All of this is a pain in the butt and I've learned to keep my images in DIB form rather than bitmaps. If you have the DIB you can always create a bitmap from them. As you can see it's not so easy going the other way.<br><br>