- 积分
- 22
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2017-7-22
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
[p=155, null, left]2
[p=182, null, left][size=169px]CRect r;GetClientRect(r);
[p=182, null, left][size=169px]pDC->SetMapMode(7);
[p=182, null, left][size=169px]pDC->SetWindowOrg(0,0);
[p=182, null, left][size=169px]pDC->SetViewportOrg(r.right/4,r.bottom/2);
[p=182, null, left][size=169px]pDC->SetWindowExt(200,100);
[p=182, null, left][size=169px]pDC->SetViewportExt(200,-100);
[p=182, null, left][size=169px]for(int i=1;i<=15;i++)
[p=182, null, left][size=169px]{ [p=182, null, left][size=169px]CPen pi(0,2,RGB(255-10*i,10*i,20*i));
[p=182, null, left][size=169px]pDC->SelectObject(pi);
[p=182, null, left][size=169px]pDC->MoveTo(300,100);
[p=182, null, left][size=169px]pDC->Arc(300-10*i,100,300+10*i,100-20*i,300,100,300,100);}} [p=207, null, left]2-2[p=207, null, left][size=193px]运行结果:
[p=207, null, left]2-3[p=207, null, left][size=193px]源程序:
[p=207, null, left]#include"math.h" [p=207, null, left]void CMy24View::OnDraw(CDC* pDC) [p=207, null, left]{CRect r;GetClientRect(r);
[p=207, null, left]pDC->SetMapMode(7);
[p=207, null, left]pDC->SetWindowOrg(0,0);
[p=207, null, left]pDC->SetViewportOrg(r.right/2,r.bottom/2);
[p=207, null, left]pDC->SetWindowExt(100,100);
[p=207, null, left]pDC->SetViewportExt(100,-100);
[p=207, null, left]CPen p1(0,2,RGB(0,0,0)); [p=207, null, left]double p3[5][2],p2[5][2];double a=3.1415926;
wap.njtsv.com [p=155, null, left]3
[p=207, null, left]for(int i=0;i<=4;i++)
[p=207, null, left]{p3[0]=100*cos((90+72*i)*a/180);
[p=207, null, left]p3[1]=100*sin((90+72*i)*a/180);
[p=207, null, left]p2[0]=38.2*cos((126+72*i)*a/180);
[p=207, null, left]p2[1]=38.2*sin((126+72*i)*a/180);}
[p=207, null, left]pDC->MoveTo(0,0);
[p=207, null, left]pDC->SelectObject(p1);
[p=207, null, left]for( i=0;i<=4;i++)
[p=207, null, left]{ pDC->MoveTo(0,0);
[p=207, null, left]pDC->LineTo(p3[0],p3[1]);
[p=207, null, left]pDC->LineTo(p2[0],p2[1]);
[p=207, null, left]pDC->MoveTo(0,0);
[p=207, null, left]pDC->LineTo(p2[0],p2[1]);
[p=207, null, left]pDC->LineTo(p3[i+1][0],p3[i+1][1]);
[p=207, null, left]pDC->MoveTo(p2[4][0],p2[4][1]);
[p=207, null, left]pDC->LineTo(p3[0][0],p3[0][1]);}} [p=207, null, left]2-3[p=207, null, left]运行结果:
[p=207, null, left][size=193px]2-4[p=207, null, left][size=193px]源程序:
[p=207, null, left]void CMy2_4View::OnDraw(CDC* pDC) [p=207, null, left]{CMy2_4Doc* pDoc = GetDocument();
[p=207, null, left]ASSERT_V[p=207, null, left]ALID(pDoc);
[p=207, null, left]CRect r;GetClientRect(r);
[p=207, null, left]pDC->SetMapMode(7);
[p=207, null, left]pDC->SetWindowOrg(0,0);
[p=207, null, left]pDC->SetViewportOrg(r.right/2,r.bottom*3/4);
[p=207, null, left]pDC->SetWindowExt(200,100);
[p=207, null, left]pDC->SetViewportExt(400,-200);
|
|