Changing the Background Color of a Dialog to match the background of a Bitmap 
Author Message
 Changing the Background Color of a Dialog to match the background of a Bitmap

m_DialogColor = m_dlg.GetColor();

m_nDlgClr = 3452816845;
int r = GetRValue(m_nDlgClr);
 int g = GetGValue(m_nDlgClr);
 int b = GetBValue(m_nDlgClr);

r = 195;
g = 195;
b = 195;

m_BitmapColor = RGB(r,g,b);
m_nBmpClr = 12829635;

// SetCurrentColor(m_nBmpClr);
// SetBackgroundColor( BOOL bSysColor, COLORREF cr );

I used GetColor() to determine the color of the dialog.  The background
of the bitmap doesn't match the background of the dialog.  Using the
RGB macro, I found the the color of the bitmap background.  I tried
using SetCurrentColor(m_nBmpClr) and SetBackgroundColor( BOOL bSysColor,
COLORREF cr ),
but neither worked.  What is the call to set the dialog to the shade of the
bitmap?
Thanks,
Brett Shifflett



Tue, 24 Feb 2004 09:41:40 GMT  
 Changing the Background Color of a Dialog to match the background of a Bitmap
To change dialog color, handle OnCtlColor()(and look for CTLCOLOR_DLG as the
last parameter).

--
Ajay Kalra [MVP - VC++]

Note: Please post all replies to newsgroup only.


Quote:
> m_DialogColor = m_dlg.GetColor();

> m_nDlgClr = 3452816845;
> int r = GetRValue(m_nDlgClr);
>  int g = GetGValue(m_nDlgClr);
>  int b = GetBValue(m_nDlgClr);

> r = 195;
> g = 195;
> b = 195;

> m_BitmapColor = RGB(r,g,b);
> m_nBmpClr = 12829635;

> // SetCurrentColor(m_nBmpClr);
> // SetBackgroundColor( BOOL bSysColor, COLORREF cr );

> I used GetColor() to determine the color of the dialog.  The background
> of the bitmap doesn't match the background of the dialog.  Using the
> RGB macro, I found the the color of the bitmap background.  I tried
> using SetCurrentColor(m_nBmpClr) and SetBackgroundColor( BOOL bSysColor,
> COLORREF cr ),
> but neither worked.  What is the call to set the dialog to the shade of
the
> bitmap?
> Thanks,
> Brett Shifflett



Tue, 24 Feb 2004 10:01:36 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Bitmap Resource Background changes color from Windows 98 to Windows 2000

2. Win2K: static background color vs. CFormView background color

3. Changing background color of dialog

4. Change Dialog BackGround Color

5. Changing Background Color of Dialog View?

6. Change background color of dialog box title

7. How to change background color of a single dialog

8. How to change background color in MFC dialog mode

9. Changing background colors for dialogs

10. Changing background color of Dialog Title bar

11. Change Dialog Box Background Color

12. Change background color of a Dialog box?

 

 
Powered by phpBB® Forum Software