try this:
OnSaveBmp()
{
// TODO: Add your command handler code here
CString sPath;
CFileDialog dlg(FALSE,".bmp","*.bmp");
if(dlg.DoModal()==IDOK){
sPath=dlg.GetPathName();
InvalidateRect(NULL, TRUE);
WriteWindowToDIB((LPSTR)(LPCSTR)sPath,this);
}
}
OnSaveBmp()
{
// TODO: Add your command handler code here
CString sPath;
CFileDialog dlg(FALSE,".bmp","*.bmp");
if(dlg.DoModal()==IDOK){
sPath=dlg.GetPathName();
InvalidateRect(NULL, TRUE);
WriteWindowToDIB((LPSTR)(LPCSTR)sPath,this);
}
}
中的CWindowDC dc(pWnd);改成CClientDC dc(pWnd);
把pWnd->GetWindowRect(rect);改成pWnd->GetClientRect(rect);
可结果还是一样的我没辙了
谢谢大家!