Reputation: 4607
I drag Image view in following way.
matrix.postTranslate(a,b);
ImageView.setImageMatrix(matrix);
I want to find values a
and b
. I can get ImageView.getImageMatrix, but how to find translated way?
Upvotes: 0
Views: 253
Reputation: 2881
Use
float[] values = new float[9];
matrix.getValues(values);
The values array will now hold the translation floats. The x translation is
values[Matrix.MTRANS_X]
The y translation is
values[Matrix.MTRANS_Y]
Upvotes: 2