0
Matrix mxTransform = new Matrix();
PathMeasure pm = new PathMeasure(pathMoveAlong, false);
//walkedLength= moved distance
pm.getMatrix(walkedLength, mxTransform,PathMeasure.POSITION_MATRIX_FLAG);
pm.getPosTan(walkedLength, pos, tan);
canvas.drawBitmap(bmImage, mxTransform, posPaint);

在我的应用程序中,我想从传感器数据中围绕一个角度旋转箭头,并沿着Path(pathMoveAlong)移动它。现在我想在他的实际位置上旋转箭头/位图。

我试过了:

mxTransform.setRotate(measuredAngle,pos[0],pos[1]);

但位图不会围绕预期位置旋转。

4

0 回答 0