..'..'20%20%30%20%10%..'1.2.WindowsXPvisualstudio20083.1.x=x..Sx,y=y.Sy;Sx,Syx,y[xy1]=[xy1]Sx000Sy00011Sx=Sy=1.522Sx=Sy=0.52.xyO5002403.xy(x,y)x=xcos-ysin,y=xsin+ycos;[xy1]=[xy1]cos0sin00sin0cos00001..'4.//DiamondView.hclassCDiamondView:publicCView{public://voidPolaris();//};//DiamondView.cppvoidCDiamondView::OnMenuDiamond(){IsCutting=FALSE;if(dlgDiamond.DoModal()==IDOK)DrawDiamond(dlgDiamond.m_nVertex,dlgDiamond.m_nRadius,100);//}//voidCDiamondView::Polaris(){......}5.//voidhzbjx(CDC*pDC,longx[18],longy[18]){CPennewPen1,*oldPen;newPen1.CreatePen(PS_SOLID,2,RGB(255,0,0));oldPen=pDC-SelectObject(&newPen1);..'POINTvertex1[11]={{x[1],y[1]},{x[2],y[2]},{x[3],y[3]},{x[4],y[4]},{x[5],y[5]},{x[3],y[3]},{x[1],y[1]},{x[6],y[6]},{x[3],y[3]},{x[7],y[7]},{x[5],y[5]}};pDC-Polyline(vertex1,11);newPen1.DeleteObject();newPen1.CreatePen(PS_SOLID,2,RGB(0,255,0));oldPen=pDC-SelectObject(&newPen1);POINTvertex2[5]={{x[6],y[6]},{x[8],y[8]},{x[9],y[9]},{x[3],y[3]},{x[8],y[8]}};pDC-Polyline(vertex2,5);POINTvertex3[5]={{x[4],y[4]},{x[10],y[10]},{x[11],y[11]},{x[3],y[3]},{x[10],y[10]}};pDC-Polyline(vertex3,5);newPen1.DeleteObject();newPen1.CreatePen(PS_SOLID,2,RGB(255,0,90));oldPen=pDC-SelectObject(&newPen1);POINTvertex4[11]={{x[12],y[12]},{x[13],y[13]},{x[3],y[3]},{x[9],y[9]},{x[14],y[14]},{x[15],y[15]},{x[3],y[3]},{x[11],y[11]},{x[12],y[12]},{x[3],y[3]},{x[14],y[14]}};pDC-Polyline(vertex4,11);newPen1.DeleteObject();newPen1.CreatePen(PS_SOLID,2,RGB(0,100,255));oldPen=pDC-SelectObject(&newPen1);POINTvertex5[5]={{x[15],y[15]},{x[16],y[16]},{x[3],y[3]},{x[16],y[16]},{x[7],y[7]}};pDC-Polyline(vertex5,5);POINTvertex6[5]={{x[2],y[2]},{x[17],y[17]},{x[3],y[3]},{x[17],y[17]},{x[13],y[13]}};pDC-Polyline(vertex6,5);pDC-SelectObject(oldPen);Sleep(10);}voidCDiamondView::Polaris(){..'InvalidateRgn(NULL);UpdateWindow();CDC*pDC=GetDC();longx[18],y[18];x[1]=553,y[1]=100;x[2]=515,y[2]=251;x[3]=553,y[3]=338;x[4]=516,y[4]=426;x[5]=553,y[5]=551;x[6]=589,y[6]=253;x[7]=591,y[7]=426;x[8]=678,y[8]=212;x[9]=641,y[9]=311;x[10]=454,y[10]=438;x[11]=478,y[11]=364;x[12]=415,y[12]=338;x[13]=466,y[13]=301;x[14]=703,y[14]=338;x[15]=640,y[15]=375;x[16]=665,y[16]=450;x[17]=440,y[17]=226;hzbjx(pDC,x,y);Sleep(500);InvalidateRect(NULL);UpdateWindow();longx1[18],y1[18];//for(doublen=1;n=0.5;n-=0.01){for(inti=1;i18;i++){..'x1[i]=Round(x[i]*n);y1[i]=Round(y[i]*n);}hzbjx(pDC,x1,y1);Sleep(10);InvalidateRect(NULL);UpdateWindow();}InvalidateRect(NULL);UpdateWindow();longx2[18],y2[18];//for(doublen=1;n=1.5;n+=0.01){for(inti=1;i18;i++){x2[i]=Round(x1[i]*n);y2[i]=Round(y1[i]*n);}hzbjx(pDC,x2,y2);Sleep(10);InvalidateRect(NULL);UpdateWindow();}InvalidateRect(NULL);UpdateWindow();hzbjx(pDC,x,y);Sleep(500);longx3[18],y3[18];//Xfor(intn=0;n=300;n+=2){..'for(intj=1;j18;j++){x3[j]=x[j]+n;y3[j]=y[j];}hzbjx(pDC,x3,y3);Sleep(1);InvalidateRect(NULL);UpdateWindow();}longx4[18],y4[18];//Yfor(intn=0;n=300;n+=2){for(intj=1;j18;j++){x4[j]=x3[j];y4[j]=y3[j]+n;}hzbjx(pDC,x4,y4);Sleep(1);InvalidateRect(NULL);UpdateWindow();}longx5[18],y5[18];//for(doublet=0;t=PI;t+=0.01){for(intk=1;k18;k++){x5[k]=Round(x[k]*cos(t)-y[k]*sin(t)-x[3]*cos(t)+y[3]*sin(t)+x[3]);y5[k]=Round(x[k]*sin(t)+y[k]*cos(t)-x[3]*sin(t)-y[3]*cos(t)+y[3]);..'}hzbjx(pDC,x5,y5);InvalidateRect(NULL);UpdateWindow();}Sleep(500);longx6[18],y6[18];//for(doublet=PI;t=0;t-=0.01){for(intk=1;k18;k++){x6[k]=Round(x[k]*cos(t)-y[k]*sin(t)-x[3]*cos(t)+y[3]*sin(t)+x[3]);y6[k]=Round(x[k]*sin(t)+y[k]*cos(t)-x[3]*sin(t)-y[3]*cos(t)+y[3]);}hzbjx(pDC,x6,y6);InvalidateRect(NULL);UpdateWindow();}Sleep(500);longx7[18],y7[18];//X=1000for(intl=1;l18;l++){x[l]=Round(x[l]*0.5);y[l]=Round(y[l]*0.5);x7[l]=1000-x[l];y7[l]=y[l];}hzbjx(pDC,x,y);..'hzbjx(pDC,x7,y7);Sleep(200);longx8[18],y8[18];//Y=600for(intl=1;l18;l++){x8[l]=x[l];y8[l]=600-y[l];}hzbjx(pDC,x,y);hzbjx(pDC,x8,y8);Sleep(200);longx9[18],y9[18];for(intl=1;l18;l++){x9[l]=1000-x[l];y9[l]=600-y[l];}hzbjx(pDC,x,y);hzbjx(pDC,x9,y9);}6...'12..'34..'57.