Click here to Skip to main content
15,895,667 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: convert image bitmap 8bits ??? wish help me Pin
Nishad S10-Nov-08 19:29
Nishad S10-Nov-08 19:29 
GeneralRe: convert image bitmap 8bits ??? wish help me Pin
Chris Losinger7-Nov-08 6:52
professionalChris Losinger7-Nov-08 6:52 
GeneralRe: convert image bitmap 8bits ??? wish help me Pin
aa_zz9-Nov-08 15:25
aa_zz9-Nov-08 15:25 
QuestionAdding one day Pin
AlProb6-Nov-08 23:04
AlProb6-Nov-08 23:04 
AnswerRe: Adding one day Pin
CPallini6-Nov-08 23:18
mveCPallini6-Nov-08 23:18 
GeneralRe: Adding one day Pin
AlProb6-Nov-08 23:25
AlProb6-Nov-08 23:25 
GeneralRe: Adding one day Pin
CPallini6-Nov-08 23:33
mveCPallini6-Nov-08 23:33 
QuestionConverting hexadecimal code into RGB Pin
Dhiraj kumar Saini6-Nov-08 22:13
Dhiraj kumar Saini6-Nov-08 22:13 
Hello,

I am working on an mfc application in which there is a colour code being fetched from the server stored in a CString. The colour code is in Hexadecimal for eg #3333FF

Now I want to set the backgroung of my control based on this color. For that I want to change the color in RGB.

I am using the following code but it is not working properly.
Please tell whats the problem.

LPTSTR pStop;
int b1,b2,b3;
CString str("#3333FF");
LPCTSTR input= str;
 
int num = _tcstol(input + 1, &pStop, 16);
b1 = (num & 0xFF0000) >> 16;
b2 = (num & 0xFF00) >> 8;
b3 = num & 0xFF;
COLORREF crBkgnd = RGB(b1 ,b2 ,b3 );		


But the above code is making the value of b1,b2 and b3 to 0.

As a result my control background is always colured in white.

Please help me.

Thanks In Advance.
Dhiraj
AnswerRe: Converting hexadecimal code into RGB Pin
CPallini6-Nov-08 22:36
mveCPallini6-Nov-08 22:36 
GeneralRe: Converting hexadecimal code into RGB Pin
Dhiraj kumar Saini6-Nov-08 22:49
Dhiraj kumar Saini6-Nov-08 22:49 
GeneralRe: Converting hexadecimal code into RGB Pin
CPallini6-Nov-08 22:52
mveCPallini6-Nov-08 22:52 
GeneralRe: Converting hexadecimal code into RGB Pin
Dhiraj kumar Saini6-Nov-08 23:34
Dhiraj kumar Saini6-Nov-08 23:34 
QuestionRe: Converting hexadecimal code into RGB Pin
David Crow7-Nov-08 2:45
David Crow7-Nov-08 2:45 
AnswerRe: Converting hexadecimal code into RGB Pin
CPallini7-Nov-08 3:31
mveCPallini7-Nov-08 3:31 
AnswerRe: Converting hexadecimal code into RGB Pin
sashoalm8-Nov-08 0:07
sashoalm8-Nov-08 0:07 
QuestionDraw on view and over their controls [modified] Pin
baerten6-Nov-08 21:53
baerten6-Nov-08 21:53 
AnswerRe: Draw on view and over their controls Pin
Nishad S7-Nov-08 1:48
Nishad S7-Nov-08 1:48 
GeneralRe: Draw on view and over their controls Pin
baerten7-Nov-08 4:20
baerten7-Nov-08 4:20 
GeneralRe: Draw on view and over their controls Pin
Nishad S7-Nov-08 23:02
Nishad S7-Nov-08 23:02 
GeneralRe: Draw on view and over their controls Pin
baerten9-Nov-08 20:53
baerten9-Nov-08 20:53 
QuestionCan i open & access view of another window in a MFC SDI application Pin
m_mun6-Nov-08 19:37
m_mun6-Nov-08 19:37 
AnswerRe: Can i open & access view of another window in a MFC SDI application Pin
Nishad S7-Nov-08 1:50
Nishad S7-Nov-08 1:50 
QuestionRegarding application expiration Pin
H4u326-Nov-08 19:22
H4u326-Nov-08 19:22 
AnswerRe: Regarding application expiration Pin
Saurabh.Garg6-Nov-08 19:56
Saurabh.Garg6-Nov-08 19:56 
GeneralRe: Regarding application expiration Pin
H4u326-Nov-08 20:11
H4u326-Nov-08 20:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.