Android Question SVG to Path: No move to and cubic to options in b4xpath?

I used https://codecrafted.net/svgtoandroid to convert svg to path. The code generated by it includes moveto and cubicto. However there seems to be no such option in b4xpath. How to incorporate moveto and cubicto in b4xpath?

B4X:
 private static final Path   t  = new Path();
         t.moveTo(322.33f,505.38f);
        t.lineTo(234.29f,728.04f);
        t.cubicTo(234.29f,751.89f,253.49f,771.09f,277.33f,771.09f);
        t.lineTo(448.38f,771.09f);
        t.cubicTo(472.23f,771.09f,491.43f,751.89f,491.43f,728.04f);
        t.lineTo(491.43f,548.43f);
        t.cubicTo(491.43f,524.58f,472.23f,505.38f,448.38f,505.38f);
 
Solution
It is based on Android native Path:
B4X:
Dim p As Path
p.Initiailize(322.33,505.38)
CubicTo(p, 234.29,751.89,253.49,771.09,277.33,771.09)
'....

'Draw it with Canvas.DrawPath

Private Sub CubicTo(p As JavaObject, f1 As Float, f2 As Float, f3 As Float, f4 As Float, f5 As Float, f6 As Float)
 p.RunMethod("cubicTo", Array(f1, f2, f3, f4, f5, f6))
End Sub

Erel

B4X founder
Staff member
Licensed User
Longtime User
It is based on Android native Path:
B4X:
Dim p As Path
p.Initiailize(322.33,505.38)
CubicTo(p, 234.29,751.89,253.49,771.09,277.33,771.09)
'....

'Draw it with Canvas.DrawPath

Private Sub CubicTo(p As JavaObject, f1 As Float, f2 As Float, f3 As Float, f4 As Float, f5 As Float, f6 As Float)
 p.RunMethod("cubicTo", Array(f1, f2, f3, f4, f5, f6))
End Sub
 
Upvote 1
Solution
It is based on Android native Path:
B4X:
Dim p As Path
p.Initiailize(322.33,505.38)
CubicTo(p, 234.29,751.89,253.49,771.09,277.33,771.09)
'....

'Draw it with Canvas.DrawPath

Private Sub CubicTo(p As JavaObject, f1 As Float, f2 As Float, f3 As Float, f4 As Float, f5 As Float, f6 As Float)
 p.RunMethod("cubicTo", Array(f1, f2, f3, f4, f5, f6))
End Sub
Thank you. Will try it.
 
Upvote 0
Top