对话框客户区画图未果求解
如题,想在对话框客户区画图,编译连接通过,执行时没画出来。。
设计的是按一个按钮然后开始画图:
void NewDialog::OnRadio1()
{
// TODO: Add your control notification handler code here
CRect picrect;
this->GetClientRect(&picrect);
//GetClientRect(&picrect);
//CWnd* dialogwnd=GetDlgItem(IDD_DIALOG1);
//if(dialogwnd!=NULL)
//dialogwnd->GetWindowRect(&picrect);
//ScreenToClient(&picrect);
//CClientDC dc(this);
PAINTSTRUCT pts;
CDC * cdc=BeginPaint(&pts);
HDC hdc=cdc->GetSafeHdc();
HBRUSH hbrush;
HPEN hpen;
hpen=(HPEN)GetStockObject(255);
hbrush=(HBRUSH)GetStockObject(255);
SelectObject(hdc,hpen);
SelectObject(hdc,hbrush);
Rectangle(hdc,0,picrect.bottom/2,picrect.right /2,picrect.bottom );
EndPaint(&pts);
DeleteObject(hpen);
DeleteObject(hbrush);
}
求大虾帮忙看看。。