vs2010 MDI多文档ribbon界面添加背景图片

来源:互联网 发布:什么是多媒体数据库 编辑:程序博客网 时间:2024/04/30 02:01

//前提需要支持GDI+;

Mainframe.h

afx_msg BOOL OnEraseMDIClientBackground( CDC *pDC );
afx_msg void OnSize(UINT nType, int cx, int cy);

Mainframe.cpp

BOOL CMainFrame::OnEraseMDIClientBackground( CDC *pDC ){
CRect rect; 
this->GetClientRect(&rect);
Graphics imgraphics(pDC->m_hDC); 
Image image(_T("328.jpg")); 
imgraphics.DrawImage(&image,0,0,rect.Width(),rect.Height()); 
return TRUE;
}

void CMainFrame::OnSize(UINT nType, int cx, int cy)
{
CMDIFrameWndEx::OnSize(nType, cx, cy);


// TODO: 在此处添加消息处理程序代码;
Invalidate(TRUE);
}

0 0