vc 在对话框显示图片
来源:互联网 发布:大智慧mac版下载 编辑:程序博客网 时间:2024/04/23 18:53
先载入一张图片,ID为IDB_BITMAP1
在TestDlg.h中
CBrush m_brBk;//在public中定义
TestDlg.cpp中
在初始化函数OnInitDialog()中加入:
BOOL CTestDlg::OnInitDialog()
{ CDialog::OnInitDialog();
CBitmap bmp;
bmp.LoadBitmap(IDB_BITMAP1);
m_brBk.CreatePatternBrush(&bmp);
bmp.DeleteObject();
return TRUE; // return TRUE unless you set the focus to a control
}
在打开类向导,找到WM_CTLCOLOR消息,重载得对应函数OnCtlColor(),添加如下:
HBRUSH CTestDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if (pWnd == this)
{
return m_brBk;
}
return hbr;
}
在TestDlg.h中
CBrush m_brBk;//在public中定义
TestDlg.cpp中
在初始化函数OnInitDialog()中加入:
BOOL CTestDlg::OnInitDialog()
{ CDialog::OnInitDialog();
CBitmap bmp;
bmp.LoadBitmap(IDB_BITMAP1);
m_brBk.CreatePatternBrush(&bmp);
bmp.DeleteObject();
return TRUE; // return TRUE unless you set the focus to a control
}
在打开类向导,找到WM_CTLCOLOR消息,重载得对应函数OnCtlColor(),添加如下:
HBRUSH CTestDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if (pWnd == this)
{
return m_brBk;
}
return hbr;
}
- vc 在对话框显示图片
- VC中在对话框上显示图片
- vc对话框显示图片
- vc对话框显示图片
- VC++中在对话框中动态显示图片
- 在对话框中显示图片
- 在对话框中显示图片
- VC中打开一幅jpg图片并且显示在对话框上的方法和代码
- VC非模态对话框在任务栏上显示
- bmp图片在对话框的全屏显示
- 在对话框显示图片的多种方法
- 在对话框显示图片补充方法
- 在对话框显示图片的多种方法
- 如何在对话框上显示一张图片
- 在对话框中显示jpg图片
- 在对话框中显示bmp图片
- VC++实现在图片上显示数字
- 在VC对话框中用ChtmlView控件显示"HTML"
- vc模态和非模态对话框置最前
- visual studio 2005/8的内置网页服务器 对非ascii码的字符的文件名支持有BUG
- 解决结合struts 2 与FCKeditor 2.4 时利用FCK的上传功能时出现提示权限不足的问题
- vc 按钮添加图标和位图
- RFC1073-Telnet窗口尺寸选项中文版
- vc 在对话框显示图片
- vc在STATIC上添加图
- RFC1939-POP3协议中文版
- vc开始→运行→输入的命令集锦
- solve the connection errors of ucenter
- vc修改对话框的背景色和字体颜色
- [规范资料]Recordset对象方法详细说明
- unix服务器安全策略
- js基础