CurveToBezier example for Delphi

var
   i: Integer;
   p: Array of TPOINT;
begin

   LEADImage1.CurveClose:= CURVE_CLOSE;
   LEADImage1.CurveSize :=   4;
   LEADImage1.CurveX[0] := 220;
   LEADImage1.CurveY[0] := 10;
   LEADImage1.CurveX[1] := 10;
   LEADImage1.CurveY[1] := 30;
   LEADImage1.CurveX[2] := 20;
   LEADImage1.CurveY[2] := 240;
   LEADImage1.CurveX[3] := 250;
   LEADImage1.CurveY[3] := 260;
   LEADImage1.CurveTension:= 0.35;
   LEADImage1.CurveType:= CURVE_STANDARD;
   LEADImage1.SetRgnCurve(L_POLY_WINDING, L_RGN_SET);
   LEADImage1.RgnFrameType:= ftAnimated;

   LEADImage1.CurveToBezier();
   SetLength ( p, LEADImage1.BezierSize ) ;
   for i:=0 to LEADImage1.BezierSize -1 do
   begin
      p[i].x:= LEADImage1.BezierX[i];
      p[i].y:= LEADImage1.BezierY[i];
   end;
   Canvas.PolyBezier(p) ;
end;