16 Bit Bitmap

How do I mask a 16 bit bitmap color (0RRRRRGGGGGBBBBB) into a RGB value ?

Thanks,
Tony.
Tony_SebastianAsked:
Who is Participating?
 
RONSLOWCommented:
int b = (c % 32)*255/31; c /= 32;
int g = (c % 32)*255/31; c /= 32;
int r = (c % 32)*255/31;
COLORREF rgb = RGB(r,g,b);


0
 
Vinayak KumbarSr Program ManagerCommented:
Hi,
pls be little more specific to ur prob. There may be another way to achive that!!.

VinExpert
0
 
Tony_SebastianAuthor Commented:
That's it !!! it works!!! for any body else out there c = WORD

int b = (c % 32)*255/31; c /= 32;
int g = (c % 32)*255/31; c /= 32;
int r = (c % 32)*255/31;
COLORREF rgb = RGB(r,g,b);

Great stuff, I don't know why they don't make this available in the SDK.

Thanks again.




0
 
RONSLOWCommented:
welcome
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.