POINT   points[6]={(100,110),(272,10),(472,10),(644,110),(472,210),(272,210)};   points[0].x=100;
points[0].y=110;
points[1].x=272;
points[1].y=10;
points[2].x=472;
points[2].y=10;
points[3].x=644;
points[3].y=110;
points[4].x=472;
points[4].y=210;
points[5].x=272;
points[5].y=210;
pDC->Polygon(points,5);
用这几个数字画的少了一个边各位帮忙修改指点一二  谢谢啦!

解决方案 »

  1.   

    应该是pDC->Polygon(points,6);
      

  2.   

    msdn的例子:   CPoint pts[4];
       pts[0].x = rect.left + rect.Width()/2;
       pts[0].y = rect.top;   pts[1].x = rect.right;
       pts[1].y = rect.top + rect.Height()/2;   pts[2].x = pts[0].x;
       pts[2].y = rect.bottom;   pts[3].x = rect.left;
       pts[3].y = pts[1].y;   // Calling Polygon() on that array will draw three lines
       // between the points, as well as an additional line to
       // close the shape--from the last point to the first point
       // we specified.
       pDC->Polygon(pts, 4);
      

  3.   

    CPoint初始值应该都是(0,0)吧,你要画图,肯定要先给各点赋值啊
      

  4.   

    没注意,你用的是POINT而不是CPoint那我也不清楚。。你可以测试下看看