I'm trying to save a DIB (%CF_DIB) bitmap from the clipboard, which works great for all bit depths except 32 bits per pixel. I can't seem to calculate the proper start of the bitmap data for that depth.
I get the 40 byte header (as read from the header_size) field.
According to the documentation I can find, when the compression field is set to BI_BITFIELDS the header should be followed by three DWORD masks. This should equal 6 bytes, right? Which means the bitmap data should start 6 bytes after the header (there's no color table with a 32 bit depth bitmap, right?)
Unfortunately, the data is not where I'm expecting it to be. What am I missing?
I tried using the %CF_BITMAP method instead, but EVERY image ends up as a 32 bit depth image.
Using the %CF_DIB method I can retain lower bit depth images, but the 32bpp image (such as using the Prnt/Scrn button on the keyboard) comes through invalid.
I'm obviously overlooking something. Any ideas?
Thanks,
Anthony
I get the 40 byte header (as read from the header_size) field.
According to the documentation I can find, when the compression field is set to BI_BITFIELDS the header should be followed by three DWORD masks. This should equal 6 bytes, right? Which means the bitmap data should start 6 bytes after the header (there's no color table with a 32 bit depth bitmap, right?)
Unfortunately, the data is not where I'm expecting it to be. What am I missing?
I tried using the %CF_BITMAP method instead, but EVERY image ends up as a 32 bit depth image.
Using the %CF_DIB method I can retain lower bit depth images, but the 32bpp image (such as using the Prnt/Scrn button on the keyboard) comes through invalid.
I'm obviously overlooking something. Any ideas?
Thanks,
Anthony
Comment