基于对话框的程序用静态文本显示位图,最小化之后再恢复就没了,如何写OnPaint函数 override OnPaint()call DIBShow(dib0,IDC_MAP2,0,0); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我现在的OnPaint函数这样的void CMyBitMapDlg::OnPaint() { if (IsIconic()) { CPaintDC dc(this); // device context for painting // Center icon in client rectangle 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; // Draw the icon dc.DrawIcon(x, y, m_hIcon); } else { SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); CDialog::OnPaint(); }}你代码的位置不对 if里面的代码只会在初始化的时候执行一次,要放到else里,再加一行CPaintDC dc(this); 文件储存目录递归 江湖救急!TCP心跳包问题! 有关CString的问题 网卡怎么设置能收到自己发送的数据包,是在驱动里完成的吗? 以全局方式hook CopyFileW? 图像保存 关于句柄和ID 同一个问题再次发铁,关于on_command_range的 散分.... 设备波特率2400,调试助手9600收到数据是什么原因? 科学计数法输出浮点数的精度问题 请问如何在工程中添加 一个自己写的头文件
void CMyBitMapDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting // Center icon in client rectangle
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; // Draw the icon
dc.DrawIcon(x, y, m_hIcon); }
else
{
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); CDialog::OnPaint();
}
}
你代码的位置不对