void CPractice37View::OnDraw(CDC* pDC)
{
CPractice37Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
CPen pen1(PS_SOLID,1,RGB(192,192,192)),pen2(PS_SOLID,1,RGB(0,0,255)),*pOldpen;
{
pDC->SelectObject(&pen1);
pDC->Rectangle(350,140,500,240);
pDC->Ellipse(375,140,475,240);
pDC->SelectObject(&pen2);
CPoint pts1[5];
for (int i=0;i<5;i++)
{
pts1[i].x=425+int (50.*cos(3.14159/2.5 * i + 3.14159/10.));
pts1[i].y=190-int (50.*sin(3.14159/2.5 * i + 3.14159/10.));
}
CPoint pts2[]={pts1[0],pts1[2],pts1[4],pts1[1],pts1[3]};
pDC->Polygon(pts2,5);
}
这个就可以画出一个星形线图,看哈对不对哈!