picture control
来源:互联网 发布:治风湿病专科医院知乎 编辑:程序博客网 时间:2024/04/28 21:26
DDX_Control(pDX, IDC_STATIC_PICTURE, m_picture);
// TODO: 在此添加控件通知处理程序代码
HBITMAP hBmp = LoadBitmap(AfxGetApp()->m_hInstance,MAKEINTRESOURCE(IDB_BITMAP2) );
BITMAP bmp;
GetObject(hBmp,sizeof(bmp),&bmp);
CRect rc;
GetClientRect(&rc);
if (bmp.bmHeight>rc.Height() )
{
rc.bottom = rc.top + bmp.bmHeight;
MoveWindow(&rc);
m_picture.MoveWindow(&rc);
}
if (bmp.bmWidth>rc.Width() )
{
rc.right = rc.left + bmp.bmWidth;
MoveWindow(&rc);
m_picture.MoveWindow(&rc);
}
m_picture.SetBitmap(hBmp);
void CpictureDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // 用于绘制的设备上下文
SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
// 使图标在工作矩形中居中
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// 绘制图标
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}
- picture control
- Picture Control装载图像
- Picture control用法
- DLG---PICTURE CONTROL
- Picture Control 打开图片
- picture control添加位图
- picture control控件
- Picture Control点击事件
- Picture Control的使用
- picture control的用法
- C++/MFC-Picture Control
- Spin Control和Picture Control关联
- picture control上显示位图
- mfc- Picture control显示图片
- MFC Picture Control显示图片
- MFC--图片控件Picture Control
- 【MFC】picture control改变背景图片
- MFC控件(12):Picture Control
- DataGridView操作
- 英语五个基本句式
- 终于可以写博客啦,感动下`
- 某pad删除内容
- 线程间通信
- picture control
- data mining decision tree
- XML简单操作-XSL
- 资源推荐 五个常用MySQL图形化管理工具
- wpf实现仿苹果水平滑动效果
- <追忆张孝祥> 郭新明:一辈子的朋友(修订版)
- Mac 10.6与Win7 文件共享
- 基数排序【经典】
- data mining statistical modeling