求VC++,MFC的对话框BITMAP的程序
要求:按一按钮跳出一对话框,在对话框上显示按钮指定的BITMAP位图这是我编的简单的程序,拖动会出现问题voidCPRINT::OnPaint(){if(m_flag==...
要求:按一按钮跳出一对话框,在对话框上显示按钮指定的BITMAP位图
这是我编的简单的程序,拖动会出现问题
void CPRINT::OnPaint()
{
if(m_flag==0)
{
bmp.LoadBitmap(IDB_BITMAP);
BITMAP bmpinfo;
bmp.GetObject(sizeof(bmpinfo),&bmpinfo);
CClientDC dc(GetDlgItem(IDC_M));
CClientDC *pDc=&dc;
CDC dcc;
dcc.CreateCompatibleDC(pDc);
dcc.SelectObject(&bmp);
CRect rect;
GetDlgItem(IDC_M)->GetWindowRect(&rect);
dc.StretchBlt(0,0,rect.Width(),rect.Height(),&dcc,0,0,bmpinfo.bmWidth,bmpinfo.bmHeight,SRCCOPY);
//CDialog::OnPaint();
m_flag=1;
}
} 展开
这是我编的简单的程序,拖动会出现问题
void CPRINT::OnPaint()
{
if(m_flag==0)
{
bmp.LoadBitmap(IDB_BITMAP);
BITMAP bmpinfo;
bmp.GetObject(sizeof(bmpinfo),&bmpinfo);
CClientDC dc(GetDlgItem(IDC_M));
CClientDC *pDc=&dc;
CDC dcc;
dcc.CreateCompatibleDC(pDc);
dcc.SelectObject(&bmp);
CRect rect;
GetDlgItem(IDC_M)->GetWindowRect(&rect);
dc.StretchBlt(0,0,rect.Width(),rect.Height(),&dcc,0,0,bmpinfo.bmWidth,bmpinfo.bmHeight,SRCCOPY);
//CDialog::OnPaint();
m_flag=1;
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询