• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 270
  • Last Modified:

16 Bit Bitmap

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

Thanks,
Tony.
0
Tony_Sebastian
Asked:
Tony_Sebastian
  • 2
1 Solution
 
Vinayak KumbarSr Program ManagerCommented:
Hi,
pls be little more specific to ur prob. There may be another way to achive that!!.

VinExpert
0
 
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
 
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now