我正在尝试在 ImageView 中旋转图像与触摸相对应以修复图像的枢轴品脱。我看过很多例子,但我不是很清楚。有人有想法..如何做到这一点?
最佳答案
由于没有提供有关位图绘制位置的代码或详细信息,我假设它位于屏幕中央。您可以像这样在中心点旋转 Canvas
double rotationAngleRadians = Math.atan2(currentX - centerX, centerY - currentY);
rotationAngleDegrees = (int) Math.toDegrees(rotationAngleRadians );
canvas.rotate(rotationAngleDegrees , centerX, centerY);
关于android - 旋转图像以及触摸以在android中固定点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4515966/