MFC中OnPaint()函数
void CSiftRegDlg::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: 在此处添加消息处理程序代码
// 不为绘图消息调用 CDialog::OnPaint()
CRect R1,R2,R3;
this->GetWindowRect(&R3);
if (m_Sen_Img_Flag)
{
m_Static.SubclassDlgItem(IDC_STATIC2,this);
m_Static.GetWindowRect(&R1);
SenImg.DrawToHDC(dc.GetSafeHdc(),CRect(R1.left - R3.left - 2, R1.top - R3.top - 25, R1.right - R3.left - 2, R1.bottom - R3.top - 25));
}
// else
// {
// // if (!is_reg)
// //UpDateStatus("请载入待配准图像!", IDC_STATIC1);
// }
if (m_Ref_Img_Flag) {
m_Static.SubclassDlgItem(IDC_STATIC3,this);
m_Static.GetWindowRect(&R2);
RefImg.DrawToHDC(dc.GetSafeHdc(),CRect(R2.left - R3.left - 2, R2.top - R3.top - 25, R2.right - R3.left - 2, R2.bottom - R3.top - 25));
// if (m_Sen_Img_Flag && !is_reg)
//UpDateStatus("点击配准键开始图像配准", IDC_STATIC1);
}
}
求大神帮我看看这段代码是否有问题,调试的时候报错提示Debug Assertion Failed.把OnPaint()函数中的代码注释掉就没有这个问题了