如何用VC画三角形的程序?是什么?

解决方案 »

  1.   

    三角形,不也就是多边形?CDC::Polygon ?
      

  2.   

    POINT pts[4];
    int x1 = 0;
    int x2 = 100;
    int y1 = 0;
    int y2 = 100;pts[0].x = (x1 + x2)/ 2;
    pts[0].y = y1 ;
    pts[1].x = x1 ;
    pts[1].y = y2 ;
    pts[2].x = x2 ;
    pts[2].y = y2 ;
    pts[3].x = (x1 + x2)/ 2;
    pts[3].y = y1 ;

    Polygon(hdc,pts,4);
      

  3.   

    CClientDC ClientDC(this);
    OnPrepareDC(&ClientDC); POINT point[3] = {{10,20},{100,200},{220,250}};
             ClientDC.Polygon(point,3);