Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does ImageView.setImageMatrix() not work?

Tags:

I want to rotate an image using ImageView.setImageMatrix(matrix) but it simply doesn't have any effect. I call matrix.postRotate(45, 20, 20); before passing it to the function above but no effect, the image is not rotated. Why?

matrix.postRotate(45, 20, 20);
ImageView.setImageMatrix(matrix)
like image 811
Roland Avatar asked Jan 23 '11 21:01

Roland


1 Answers

I'm not really sure but I think you should set scale type:

imgView.setScaleType(ScaleType.MATRIX);

You can also do that in XML with android:scaleType="matrix".

like image 184
bigstones Avatar answered Sep 20 '22 21:09

bigstones