Click to See Complete Forum and Search --> : How do you copy a DIB to the ckipboard?


Mike Newberry
April 23rd, 1999, 12:38 PM
Can someone tell me how to take an arbitrary DIB and put it on the clipboard? I am not referring to a screen capture, and there's no DC involved here (unless I'm missing something). The snag is converting an 8 bit DIB containing a look up table (palette) to a CBitmap for the clipboard. It appears that the clipboard supports only 24 bit for color images. Questions:

1. Is it really 24 bit or is it 32 bit per pixel? The VC docs are *terrible* about explaining this in any depth.
2. Do I really have to plow through the bitmap, pixel by pixel, and expand the 8 bit pixels using the color look up table into 24/32 bit pixels? Or is there a Windows function that will do this?

Thanks!