用VC++画坐标轴的问题
来源:百度知道 编辑:UC知道 时间:2024/05/28 09:38:03
邮箱:wangyiyou_107@163.com
CClientDC dc(this);
CDC* pDC=&dc;
//////////定义画笔
CPen pen(1,1,RGB(0,0,255)),pen1(1,1,RGB(255,0,0));
CPen *pold_pen=pDC->SelectObject(&pen);
//////////定义画笔
CRect rect;
GetClientRect(&rect);
rect.top+=100;
rect.left+=100;
rect.right-=100;
rect.bottom-=100;
pDC->SetMapMode(MM_ANISOTROPIC);
pDC->SetViewportOrg(10,10);
//pDC->SetViewportOrg(900,5000);
pDC->SetViewportExt(rect.right-rect.left,rect.bottom-rect.top);//设置视口范围
pDC->SetWindowOrg(10,10);
//pDC->SetViewportOrg(900,5000);
pDC->SetWindowExt(1800,10000);
pDC->MoveTo(0,5000);
pDC->LineTo(1800,5000);
pDC->MoveTo(100,0);
pDC->LineTo(100,10000);
pDC->MoveTo(100,11000);
pDC->LineTo(1800,11000);
//以上部分画的是坐标
for(int j=0;j<16;j++)
{
CPen pen(0,1,RGB(0,255,255));
CStrin