Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Reading Color Values from the Framebuffer

When using functions that read back color values from the framebuffer, be aware of the differences between reading RGBA values and color-index values on true-color devices and on palette-based devices.

On a true-color device:

  • RGBA values are limited to the channel in the device.
  • Color-index values are stored as RGBA values in the framebuffer. When using these values, you must perform an inverse translation from RGBA to the logical palette index. If two logical indexes have the same RGBA values, the wrong index can be returned.

On a palette-based device:

  • RGBA values are read from an index in the system palette. The logical index is obtained from an inverse table, and the RGBA components are extracted.
  • Color-index values are read from an index into the system palette and an inverse table is used to get the logical palette index.



Send comments about this topic to Microsoft

Build date: 3/6/2012

Community Additions

© 2015 Microsoft