15,877,547 members
Home / Discussions / C / C++ / MFC

# C / C++ / MFC

 Converting hexadecimal code into RGB Dhiraj kumar Saini6-Nov-08 22:13 Dhiraj kumar Saini 6-Nov-08 22:13
 Re: Converting hexadecimal code into RGB CPallini6-Nov-08 22:36 CPallini 6-Nov-08 22:36
 Re: Converting hexadecimal code into RGB Dhiraj kumar Saini6-Nov-08 22:49 Dhiraj kumar Saini 6-Nov-08 22:49
 Re: Converting hexadecimal code into RGB CPallini6-Nov-08 22:52 CPallini 6-Nov-08 22:52
 Re: Converting hexadecimal code into RGB Dhiraj kumar Saini6-Nov-08 23:34 Dhiraj kumar Saini 6-Nov-08 23:34
 Re: Converting hexadecimal code into RGB David Crow7-Nov-08 2:45 David Crow 7-Nov-08 2:45
 Re: Converting hexadecimal code into RGB CPallini7-Nov-08 3:31 CPallini 7-Nov-08 3:31
 Re: Converting hexadecimal code into RGB sashoalm8-Nov-08 0:07 sashoalm 8-Nov-08 0:07
 See the definition of RGB: #define RGB(r,g,b) ((COLORREF)(((BYTE)(r)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(b))<<16))) What RGB does is it gives you a hexadecimal number. ```COLORREF cr = 0x000000ff; COLORREF cr = RGB(255, 0, 0);```are equivalent. You can replace ```int num = _tcstol(input + 1, &pStop, 16); b1 = (num & 0xFF0000) >> 16; b2 = (num & 0xFF00) >> 8; b3 = num & 0xFF; COLORREF crBkgnd = RGB(b1 ,b2 ,b3 );``` with `COLORREF crBkgnd = _tcstol(input + 1, &pStop, 16);` There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal
 Draw on view and over their controls [modified] baerten6-Nov-08 21:53 baerten 6-Nov-08 21:53
 Re: Draw on view and over their controls Nishad S7-Nov-08 1:48 Nishad S 7-Nov-08 1:48
 Re: Draw on view and over their controls baerten7-Nov-08 4:20 baerten 7-Nov-08 4:20
 Re: Draw on view and over their controls Nishad S7-Nov-08 23:02 Nishad S 7-Nov-08 23:02
 Re: Draw on view and over their controls baerten9-Nov-08 20:53 baerten 9-Nov-08 20:53
 Can i open & access view of another window in a MFC SDI application m_mun6-Nov-08 19:37 m_mun 6-Nov-08 19:37
 Re: Can i open & access view of another window in a MFC SDI application Nishad S7-Nov-08 1:50 Nishad S 7-Nov-08 1:50
 Regarding application expiration H4u326-Nov-08 19:22 H4u32 6-Nov-08 19:22
 Re: Regarding application expiration Saurabh.Garg6-Nov-08 19:56 Saurabh.Garg 6-Nov-08 19:56
 Re: Regarding application expiration H4u326-Nov-08 20:11 H4u32 6-Nov-08 20:11
 Re: Regarding application expiration Saurabh.Garg6-Nov-08 20:17 Saurabh.Garg 6-Nov-08 20:17
 Re: Regarding application expiration H4u326-Nov-08 20:21 H4u32 6-Nov-08 20:21
 Re: Regarding application expiration Saurabh.Garg6-Nov-08 20:28 Saurabh.Garg 6-Nov-08 20:28
 Re: Regarding application expiration H4u326-Nov-08 20:33 H4u32 6-Nov-08 20:33
 Re: Regarding application expiration Saurabh.Garg6-Nov-08 20:48 Saurabh.Garg 6-Nov-08 20:48
 Re: Regarding application expiration David Crow7-Nov-08 2:50 David Crow 7-Nov-08 2:50
 Re: Regarding application expiration beko6-Nov-08 20:45 beko 6-Nov-08 20:45
 Last Visit: 31-Dec-99 18:00     Last Update: 13-Apr-24 12:52 Refresh ᐊ Prev1...3890389138923893389438953896389738983899 Next ᐅ