Solved

16 Bit Bitmap

Posted on 2000-04-12
4
211 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

747 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

10 Experts available now in Live!

Get 1:1 Help Now