GetClientRect(&rctClient);改为pPictureWnd->GetClientRect(&rctClient);且放到CWnd* pPictureWnd = GetDlgItem(IDC_STATIC_graphic1);下方画完以后还要恢复画笔pDC->SelectObject(pOldPen); pen.DeleteObject();ReleaseDC(pDC);