I need to scale an Image inside an ImageView, I need to use the matrix for doing so,
So I do;
private void scaleImage(float scaleFactor, float focusX,float focusY) {
Matrix displayMatrix= new Matrix();
matrix.postScale(scaleFactor, scaleFactor);
displayMatrix.set(matrix);
imageView.setImageMatrix(displayMatrix);
}
The problem is no matter what i am not able to center the image inside the ImageView,
I need to put the image at the center (leaving white margins if the image is smaller than the view)
I have been bangin my head for hours, please help.
I have looked extensively at this https://stackoverflow.com/a/6172226/1815311, but without success.