ahtri
asked on
Color and Pallete entry
I have an application that has the display come with a custome color pallete:
PALETTEENTRY ColourEntries[276];
When I get the color at the cursor by:
COLORREF PixelAtPointer = dc.GetPixel( point );
How to reference the COLORREF against the PALETTEENTRY ? I want to find the index of the pixel color in the pallete entry.
Thanks
PALETTEENTRY ColourEntries[276];
When I get the color at the cursor by:
COLORREF PixelAtPointer = dc.GetPixel( point );
How to reference the COLORREF against the PALETTEENTRY ? I want to find the index of the pixel color in the pallete entry.
Thanks
ASKER
how to split the COLORREF ? can you give me some sample code
COLORREF PixelAtPointer = dc.GetPixel( point );
BYTE byteRVal = GetRValue(PixelAtPointer);
GOOD LUCK
BYTE byteRVal = GetRValue(PixelAtPointer);
GOOD LUCK
ASKER
I'm struggling to understand this code:
ShortRed=ColourEntries[i+2 0].peRed/8 ; ShortGreen=ColourEntries[i +20].peGre en/4;
ShortBlue=ColourEntries[i+ 20].peBlue /8;
ColourIndex[i]=ShortRed*20 48+ShortGr een*32+Sho rtBlue;
Do you have any idea about those "8", "4", "32", "2048" ?
ShortRed=ColourEntries[i+2
ShortBlue=ColourEntries[i+
ColourIndex[i]=ShortRed*20
Do you have any idea about those "8", "4", "32", "2048" ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
the macros are GetRValue(crf);GetGValue(c
PALLETTEENTRY gives the bytes of the RGB,
So you can either combine these rgb value and compare with COLORREF , or split the COLORREF and compare with the pallette entry.
GOOD LUCK