COLORREF information
I''m sorry, but I would like to ask another Q. I use GetPixel to get the pixel at a location. I have it stored in a COLORREF. How would you read each indivual color(red, green , blue) and store it in 3 seperate ints?
October 27, 2001 07:23 PM
I''ll give it a try.
According to the MSDN the colorref value is stored like this:
0x00bbggrr
The code might be all wrong but I think the general idea is that you have to use the bitwise and shift operators.
According to the MSDN the colorref value is stored like this:
0x00bbggrr
COLORREF pixel;int red, green, blue;red = pixel & 0xFF;pixel = pixel >> 8;green = pixel & 0xFF;pixel = pixel >> 8;blue = pixel & 0xFF;
The code might be all wrong but I think the general idea is that you have to use the bitwise and shift operators.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement