TRACE输出在哪里啊,我有这样的代码,可是调试输出在哪里啊
voidCMapModeView::OnPaint(){CPaintDCdc(this);//获取设备类的设置CPointptOrgView,ptOrgWindow;CS...
void CMapModeView::OnPaint()
{
CPaintDC dc(this);
//获取设备类的设置
CPoint ptOrgView,ptOrgWindow;
CSize sizeView,sizeWindow;
CString strMsg;
ptOrgView=dc.GetViewportOrg();//获取视口原点
ptOrgWindow=dc.GetWindowOrg();//获取窗口原点
sizeView=dc.GetViewportExt();//获取视口范围
sizeWindow=dc.GetWindowExt();//获取窗口范围
strMsg.Format(_T("Viewport Extent:(%d,%d),\tViewport Org:(%d,%d)\tWindow Extent:(%d,%d)\tWindow Org(%d,%d)"),
sizeView.cx,sizeView.cy,ptOrgView.x,ptOrgView.y,
sizeWindow.cx,sizeWindow.cy,ptOrgWindow.x,ptOrgWindow.y);
TRACE("%s\n",strMsg);
//设置映射模式以及原点
dc.SetMapMode(MM_TEXT);//设置映射模式
dc.SetWindowOrg(100,100);//设置窗口的坐标原点
dc.SetViewportOrg(200,200);//设置视口的坐标原点
dc.SetWindowExt(5,10);//改语句仅对可变比例映射模式有效
dc.SetViewportExt(1,1);//同上
ptOrgView=dc.GetViewportOrg();
ptOrgWindow=dc.GetWindowOrg();
sizeView=dc.GetViewportExt();
sizeWindow=dc.GetWindowExt();
strMsg.Format(_T("Viewport Extent:(%d,%d),\tViewport Org:(%d,%d)\tWindow Extent:(%d,%d)\tWindow Org(%d,%d)"),
sizeView.cx,sizeView.cy,ptOrgView.x,ptOrgView.y,
sizeWindow.cx,sizeWindow.cy,ptOrgWindow.x,ptOrgWindow.y);
TRACE("%s\n",strMsg);
//将点(300,400)从逻辑坐标体系映射到设备坐标体系。
CPoint ptMap;
ptMap=CPoint(300,400);
dc.LPtoDP(&ptMap);
strMsg.Format(_T("The Orginal Point(In LP):CPoint(300,400),Convert to DP is:CPoint(%d,%d)"),
ptMap.x,ptMap.y);
TRACE("%s\n",strMsg);
//将点(300,400)从设备坐标体系映射到逻辑坐标体系
ptMap=CPoint(300,400);
dc.DPtoLP(&ptMap);
strMsg.Format(_T("The Orginal Point(In DP):CPoint(300,400),Convert to LP is:CPoint(%d,%d)"),
ptMap.x,ptMap.y);
TRACE("%s\n",strMsg);
} 展开
{
CPaintDC dc(this);
//获取设备类的设置
CPoint ptOrgView,ptOrgWindow;
CSize sizeView,sizeWindow;
CString strMsg;
ptOrgView=dc.GetViewportOrg();//获取视口原点
ptOrgWindow=dc.GetWindowOrg();//获取窗口原点
sizeView=dc.GetViewportExt();//获取视口范围
sizeWindow=dc.GetWindowExt();//获取窗口范围
strMsg.Format(_T("Viewport Extent:(%d,%d),\tViewport Org:(%d,%d)\tWindow Extent:(%d,%d)\tWindow Org(%d,%d)"),
sizeView.cx,sizeView.cy,ptOrgView.x,ptOrgView.y,
sizeWindow.cx,sizeWindow.cy,ptOrgWindow.x,ptOrgWindow.y);
TRACE("%s\n",strMsg);
//设置映射模式以及原点
dc.SetMapMode(MM_TEXT);//设置映射模式
dc.SetWindowOrg(100,100);//设置窗口的坐标原点
dc.SetViewportOrg(200,200);//设置视口的坐标原点
dc.SetWindowExt(5,10);//改语句仅对可变比例映射模式有效
dc.SetViewportExt(1,1);//同上
ptOrgView=dc.GetViewportOrg();
ptOrgWindow=dc.GetWindowOrg();
sizeView=dc.GetViewportExt();
sizeWindow=dc.GetWindowExt();
strMsg.Format(_T("Viewport Extent:(%d,%d),\tViewport Org:(%d,%d)\tWindow Extent:(%d,%d)\tWindow Org(%d,%d)"),
sizeView.cx,sizeView.cy,ptOrgView.x,ptOrgView.y,
sizeWindow.cx,sizeWindow.cy,ptOrgWindow.x,ptOrgWindow.y);
TRACE("%s\n",strMsg);
//将点(300,400)从逻辑坐标体系映射到设备坐标体系。
CPoint ptMap;
ptMap=CPoint(300,400);
dc.LPtoDP(&ptMap);
strMsg.Format(_T("The Orginal Point(In LP):CPoint(300,400),Convert to DP is:CPoint(%d,%d)"),
ptMap.x,ptMap.y);
TRACE("%s\n",strMsg);
//将点(300,400)从设备坐标体系映射到逻辑坐标体系
ptMap=CPoint(300,400);
dc.DPtoLP(&ptMap);
strMsg.Format(_T("The Orginal Point(In DP):CPoint(300,400),Convert to LP is:CPoint(%d,%d)"),
ptMap.x,ptMap.y);
TRACE("%s\n",strMsg);
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询