|
BOOL CAaaDlg :: OnInitDialog ()
{
CDialog :: OnInitDialog ();
// Load the bitmap
m_Back.LoadBitmap (IDB_BITMAP1);
Ranch
return TRUE; // return TRUE unless you set the focus to a control
}
BOOL CAaaDlg :: OnEraseBkgnd (CDC * pDC)
{
CDC dc;
dc.CreateCompatibleDC (pDC);
dc.SelectObject (&m_Back);
// Get the BITMAP object
BITMAP hb;
m_Back.GetBitmap (&hb);
// Get window size
CRect rt;
GetClientRect (&rt);
// Display bitmap
pDC-> StretchBlt (0, 0, rt.Width (), rt.Height (),
&dc, 0, 0, hb.bmWidth, hb.bmHeight, SRCCOPY);
return TRUE;
// return CDialog :: OnEraseBkgnd (pDC);
}
HBRUSH CAaaDlg :: OnCtlColor (CDC * pDC, CWnd * pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog :: OnCtlColor (pDC, pWnd, nCtlColor);
Ranch
// Set transparent background mode
pDC-> SetBkMode (TRANSPARENT);
// Set the background brush to empty
return (HBRUSH) :: GetStockObject (HOLLOW_BRUSH);
} |
|