Thirty-Two bits-per-pixel format is another true color format. This format does not cause pixels to cross DWORD boundries, but is less efficient in memory use. There are two ways to arrange the color channels in this format. One puts blue in the least significant byte of each pixel, and the other puts red in the least significant byte. These options correspond to the PAL_BGR and PAL_RGB modes. Microsoft recommends using PAL_RGB for slightly better performance. You can use the following masks to extract red, green, blue, and alpha channels from each pixel:
Color | PAL_RGB Mask | PAL_BGR Mask |
---|---|---|
Red | 0x000000FF | 0x00FF0000 |
Green | 0x0000FF00 | 0x0000FF00 |
Blue | 0x00FF0000 | 0x000000FF |
If you product does not use an alpha channel, use 0x00000000 as the mask for alpha. Memory for this format can be arranged like this: