64,636
社区成员
发帖
与我相关
我的任务
分享
pDC=new CPaintDC(this);
CRect cRect;
pDC->SetMapMode(MM_ISOTROPIC); //设定各同向性坐标系
AfxGetMainWnd()->GetClientRect(cRect);
pDC->SetWindowExt(1800,1800);//设置窗口大小
pDC->SetWindowOrg(0, 0);
pDC->SetViewportExt(cRect.Width(),-cRect.Height());
pDC->SetViewportOrg(cRect.Width()/2,cRect.Height()/2); //设置视口原点为中心,两原点之间建立映射,扩展之间成比例
CDC * dc = GetWindowDC();
OnPrepareDC(dc);
dc->DPtoLP(&point);
//ScreenToClient(&point);
str1.Format(L"%d<->%d",point.x,point.y);
,后来发现point中的坐标仍然还是物理坐标系中的坐标,即原点是从左上角计算的,而我想要的是逻辑坐标,请问各位大侠,这段代码到底出了什么问题呢,在线等,求救啊!!!