Android PhotoView - 缩放到之前的位置(x y 坐标和比例)

Android PhotoView - zoom to previous position (x y coordinates and scale)

我正在使用 https://github.com/chrisbanes/PhotoView 以便用户可以缩放图像然后绘制一些点。

还有删除这个点的功能。在这种情况下,我重绘了整个位图:

matrix = new Matrix();
canvas.drawBitmap(bmp, matrix, paint);
setImageBitmap(bmp);

但现在我想将图像缩放到之前的 position/coordinates。

这应该有效:

setScale(scale, focalX, focalY, false);

我知道比例,但我需要 focalX,focalY。

我怎样才能得到它?也许我应该以某种方式从

计算出来
getSuppMatrix(matrix);

但我不确定这是否可能以及如何实现。

你有什么建议吗?有帮助吗?

通过获取矩阵解决

getSuppMatrix(matrix);

设置新位图之前

setImageBitmap(bmp);

然后设置上一个矩阵

setSuppMatrix(matrix);