0

My actual requirement is to tilt the image from -45 to 45 degrees. How to scale and rotate the image at the same time by using the matrix?

Like this https://www3.lunapic.com/editor/?action=straighten

I have added the image in the image view and tried to rotate the image by rotating the ImageView but it is not working properly and also I don't know how much zoom the image based on the angle.

If I set the angle is 45 to the image what is the scale factor of the image? (I mean how much I have to set)

Santhiya
  • 191
  • 2
  • 14
  • https://stackoverflow.com/questions/22460349/how-can-i-rotate-an-imageview provided the solution about rotation. What about scaling the image by using the matrix? – Santhiya Nov 04 '20 at 18:01
  • use `Matrix.SetScale` – Jason Nov 04 '20 at 18:37
  • @Jason If I used `mat.PostRotate(numProgress);`and `Matrix.SetScale` simultaneously, just `mat.PostRotate(numProgress)` will work. `Matrix.SetScale` will not work, I change the `mat.SetScale(xValue, yValue);` to `mat.PostScale(xValue, yValue);` it will work. – Leon Nov 05 '20 at 02:41
  • @Santhiya If you set the angle is 45, you can use `float xValue = 45/10`, it will scale 4.5 times – Leon Nov 05 '20 at 02:47

0 Answers0