赞
踩
首先导入你的图片(*.BMP)做为图片资源Bitmap,ID改为IDB_BMP;
CBitmap m_bmp;
CBrush m_brush;
m_bmp.LoadBitmap(IDB_BMP);//IDB_BMP 是图片资源ID
m_brush.CreatePatternBrush(&m_bmp);
//对话框WM_CTLCOLOR 消息函数
HBRUSH CDiaDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if(nCtlColor==CTLCOLOR_DLG)
return m_brush;
return hbr;
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。