Android数组的路径 - 读取路径上的点?

Mat*_*att 15 android path

有没有办法读取绘制路径时创建的点?对我来说,路径无法读取似乎很愚蠢.

或者手动将当前手指位置写入阵列是否更好?

谢谢

Edu*_*ard 33

您可以从任何路径中读取任意数量的点.示例如何从路径中间读取坐标:

    PathMeasure pm = new PathMeasure(myPath, false);
    //coordinates will be here
    float aCoordinates[] = {0f, 0f};

    //get coordinates of the middle point
    pm.getPosTan(pm.getLength() * 0.5f, aCoordinates, null);
Run Code Online (Sandbox Code Playgroud)

您可以从路径起点传递任何距离以获得点坐标.

  • @JhansiKiRani,他就在那里://坐标将在这里.所以在一个坐标. (4认同)