资源描述:
《西南交大c++编程绘图作业》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、CRectrc;GetClientRect(rc);pDC->SetMapMode(7);pDC->SetWindowExt(1,1);pDC->SetViewportExt(2,-2);pDC->SetViewportOrg(rc.right/2,rc.bottom/2);intpa⑸[2]={0,0,0,120,-240,0,240,0,0,120};POINTpb[9]={・160,0,-160,40,-80,0,-80,80,0,0,80,80,80,0,160,40,160,0};CPenpen(0,2,RGB(0,0,0));pDC->SelectOb
2、ject(pen);pDC->MoveTo(pa[0][0],pa[0][1]);for(inti=l;iv=4;i++)pDC->LineTo(pa[i][0],pa[i][1]);pDC->Polyline(pb,9);CRectrc;GetClientRect(rc);pDC->SetMapMode(7);pDC->SetWindowExt(1,1);pDC->SetViewportExt(1,-1);pDC->SetViewportOrg(rc.right/2,rc.bottom/2);CPen*p01,*p02;pDC->SelectStockObjec
3、t(NULL_BRUSH);for(inti=1;i<=15;i++){pO1=newCPen(0,2RGB(10*i,0,5*i));p02=pDC->SelectObject(p()1);pDC->Ellipse(300-l()*i,100,300+10*i,1()()・20*i);pDC->SelectObject(p02);deletepOl;}#includeumath.h"CRectrc;GetClientRect(rc);pDC->SetMapMode(7);pDC->SetWindowExt(1,1);pDC->SetViewportExt(2,-
4、2);pDC->SetViewportOrg(rc.right/2,rc.bottom/2);CPenpen(0,2,RGB(0,0,0));pDC->SelectObject(pen);doublepp[12][2],rl=100,r2=38.2;for(inti=1;i<=11;i=i+2){pp[i][0]=rl*cos(1.571+(i-l)/2*2*3.1415926/5);pp[i][1]=rl*sin(1.571+(i・1)/2*2*3・1415926/5);}for(i=2;i<=10;i=i+2){pp[i][0]=r2*cos(1.571+0.
5、62831852+(i・2)/2*2*3」415926/5);pp[i][l]=r2*sin(1.571+0.62831852+(12)/2*2*3.1415926/5);}pDC->MoveTo(pp[l]⑹,pp[1][1]);for(i=2;i<=ll;i++)pDC->LineTo(pp[i][0],pp[i][l]);for(intj=1,k=6;j<=5;j++,k++){pDC->MoveTo(pp[j][0],pp[j][l]);pDC->LineTo(pp[k][0],pp[k][l]);}CRectrc;GetClientRect(rc);pD
6、C->SetMapMode(7);pDC->SetWindowExt(1,1);pDC->SetViewportExt(2,-2);pDC->SetViewportOrg(rc.right/2,rc.bottom/2);pDC->MoveTo(-5,0);pDC->LineTo(-5,100);pDC->LineTo(5,100);pDC->LineTo(5,0);pDC->MoveTo(-85,0);pDC->LineTo(85,0);pDC->MoveTo(-15,10);pDC->ArcTo(-85,10,-65,-10,-75,10,-85,0);pDC-
7、>MoveTo(-15,10);pDC->SetArcDirection(AD_CLOCKWISE);pDC->ArcTo(-15,80,5,60,-15,70,-5,80);pDC->MoveTo(15,10);pDC・>ArcTo(65,10,85,・10,75,10,85,0);pDC->MoveTo(15,10);pDC->SetArcDirection(AD_COUNTERCLOCKWISE);pDC->ArcTo(-5,80,15,60,15,70,5,80);CRectrc;GetClientRect(rc);pDC->SetMapMode(7);p
8、DC->S