Solved

16 Bit Bitmap

Posted on 2000-04-12
4
233 Views
Last Modified: 2013-11-20
How do I mask a 16 bit bitmap color (0RRRRRGGGGGBBBBB) into a RGB value ?

Thanks,
Tony.
0
Comment
Question by:Tony_Sebastian
  • 2
4 Comments
 
LVL 8

Expert Comment

by:VinExpert
ID: 2710456
Hi,
pls be little more specific to ur prob. There may be another way to achive that!!.

VinExpert
0
 
LVL 10

Accepted Solution

by:
RONSLOW earned 100 total points
ID: 2710725
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
 

Author Comment

by:Tony_Sebastian
ID: 2712208
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
 
LVL 10

Expert Comment

by:RONSLOW
ID: 2712353
welcome
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Turn a spreadsheet into a vba executable. 2 85
Expand LInux Boot partition remotly 3 90
Sed question 2 83
Change to event 1 111
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now