Re: GetDIBits(): Handle Bitfields properly
"Michael Kaufmann" <hallo(a)michael-kaufmann.ch> wrote:
+ if (bpp > 0 && compr == BI_BITFIELDS) + { + /* Windows ignores the input bitfields and overwrites them */ + + if (bpp == 16) + { + /* With these bitfields, the color data is the same as for BI_RGB */ + ((PDWORD)info->bmiColors)[0] = 0x7c00; + ((PDWORD)info->bmiColors)[1] = 0x03e0; + ((PDWORD)info->bmiColors)[2] = 0x001f; + } + else if (bpp == 32) + { + /* With these bitfields, the color data is the same as for BI_RGB */ + ((PDWORD)info->bmiColors)[0] = 0xff0000; + ((PDWORD)info->bmiColors)[1] = 0x00ff00; + ((PDWORD)info->bmiColors)[2] = 0x0000ff; + }
What happens in 15 and 24 bpp cases? -- Dmitry.
+ if (bpp > 0 && compr == BI_BITFIELDS) + { + /* Windows ignores the input bitfields and overwrites them */ + + if (bpp == 16) + { + /* With these bitfields, the color data is the same as for BI_RGB */ + ((PDWORD)info->bmiColors)[0] = 0x7c00; + ((PDWORD)info->bmiColors)[1] = 0x03e0; + ((PDWORD)info->bmiColors)[2] = 0x001f; + } + else if (bpp == 32) + { + /* With these bitfields, the color data is the same as for BI_RGB */ + ((PDWORD)info->bmiColors)[0] = 0xff0000; + ((PDWORD)info->bmiColors)[1] = 0x00ff00; + ((PDWORD)info->bmiColors)[2] = 0x0000ff; + }
What happens in 15 and 24 bpp cases?
In theory, bitfields are not possible for 24 bpp modes - I'll add a test for this. Do you have any information about the 15 bpp case? Are some applications using this value? According to MSDN, it is not allowed. Regards Michael
"Michael Kaufmann" <hallo(a)michael-kaufmann.ch> wrote:
Do you have any information about the 15 bpp case? Are some applications using this value? According to MSDN, it is not allowed.
15 bpp case should be similar to a 16-bit one but with different masks. -- Dmitry.
participants (2)
-
Dmitry Timoshkov -
Michael Kaufmann