Jump to content


Photo

Drawing splines ?


  • Please log in to reply
1 reply to this topic

#1 Flemming

Flemming
  • Members
  • 47 posts

Posted 15 October 2013 - 10:52 PM

Hi

Is it somehow possible to draw splines ? I know the quadraticcurve and beziercurve, but they both depends on controlpoints. I would like a solution that just makes the best fit (splines).

#2 Flemming

Flemming
  • Members
  • 47 posts

Posted 16 October 2013 - 12:30 AM

Ok, i just found a solution with quadraticcurve that works for me:

 if p.Length > 0 then 
   for var Index := 0 to p.Length - 2 do 
   begin 
     dx := (p[Index].x + p[Index + 1].x) div 2; 
     dy := (p[Index].y + p[Index + 1].y) div 2; 
     canvas.QuadraticCurveToF( p[Index].x, p[Index].y, dx, dy); 
   end; 





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users