现在想用折线来拟合贝塞尔曲线,不过就是不明白二次,3次贝塞尔曲线的函数表示。

解决方案 »

  1.   

    myGraphics.DrawBezier(myPen, 0, 0, 40, 20, 80, 150, 100, 10);
      

  2.   

    楼上是GDI+的DrawBezier:
    Graphics::DrawBezier(Pen*,POINT&,POINT&,POINT&,POINT&)
    Graphics::DrawBezier(Pen*,POINTF&,POINTF&,POINTF&,POINTF&)
    Graphics::DrawBezier(Pen*,REAL,REAL,REAL,REAL,REAL,REAL,REAL,REAL)
    Graphics::DrawBezier(Pen*,INT,INT,INT,INT,INT,INT,INT,INT)GDI+还有:
    Graphics::DrawBeziers(Pen*,Point*,INT)
    Graphics::DrawBeziers(Pen*,PointF*,INT)
    用于画连续的多组贝塞尔曲线。GDI的是PolyBezier和PolyBezierTo:
    BOOL PolyBezier(
      HDC hdc,            // handle to device context
      CONST POINT* lppt,  // endpoints and control points
      DWORD cPoints       // count of endpoints and control points
    );BOOL PolyBezierTo(
      HDC hdc,            // handle to device context
      CONST POINT *lppt,  // endpoints and control points
      DWORD cCount        // count of endpoints and control points
    );
      

  3.   

    http://antigrain.com/research/bezier_interpolation/
      

  4.   

    http://antigrain.com/research/bezier_interpolation/里讲的是讲直线拟合为曲线,我现在是想将曲线拟合为直线。
    GDI+的路径有一个函数Flatten()可将曲线拟合转换为直线,但是想自己用算法实现