0

I designed a paint app in android studio for freehand drawing. I wonder if there is a way make 'path.quadto(p1,P2)' in delphi 10.4 pr xe8. the problem is there are too many, but none of them give the same result on android.

'path.curveto(p1,p2,p3);'
'path.smoothcurveto(p2,p3);'
'Path.quadcurveto(p2,p3);'

If two points have distance greater than the tolerance then I use 'path.quadto' in java, but I can't do that in firemonkey. It always draws lines.

Akshay Hazari
  • 3,186
  • 4
  • 48
  • 84
  • I've learnt myself that TPathData isn't complete in terms of functionality compared to other path implementations, such as SVG. Converting a path from FMX to other formats is a lot easier than going the other way. FMX is using cubics only. You could try computing the cubic control points from the quadratic one. https://stackoverflow.com/questions/2009160/how-do-i-convert-the-2-control-points-of-a-cubic-curve-to-the-single-control-poi – XylemFlow Dec 21 '20 at 09:47
  • The last link I gave had the wrong conversion (cubic to quadratic). What you want is quadratic to cubic, which is easier and almost exact. https://stackoverflow.com/questions/3162645/convert-a-quadratic-bezier-to-a-cubic-one – XylemFlow Dec 21 '20 at 09:55

1 Answers1

0

FMX uses only cubic Beziers, but you can always compute a cubic from a quadratic (you can't always go the other way). Just use the equations given in the following link.

Convert a quadratic bezier to a cubic one

XylemFlow
  • 963
  • 5
  • 12