Question

I have a andoid.graphics.path already created with moveto(),lineTo(),cubeto() and close().

How do I get back all these operations ? I mean something like the following pseodcode:

operations[] = getOperations(mypath);
String sOperation=operation[0].type; // moveto,cubeto,lineto,close
int X=operation[0].x;    
int Y=operation[0].y;
Was it helpful?

Solution

I'm afraid this isn't possible. In the source of android.graphics.Path, you'll observe that the method directly invokes the native method, and doesn't provide any mechanism of retrieving the segments.

If you wish to keep the tuples, I'd suggest maintaining your own array.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top