Domanda

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;
È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top