List of usage examples for android.graphics Matrix preRotate
public boolean preRotate(float degrees, float px, float py)
From source file:Main.java
public static boolean setImageToScreenMatrix(Matrix dst, RectF image, RectF screen, int rotation) { RectF rotatedImage = new RectF(); dst.setRotate(rotation, image.centerX(), image.centerY()); if (!dst.mapRect(rotatedImage, image)) { return false; // fails for rotations that are not multiples of 90 // degrees }/*w w w. ja v a 2s .co m*/ boolean rToR = dst.setRectToRect(rotatedImage, screen, Matrix.ScaleToFit.CENTER); boolean rot = dst.preRotate(rotation, image.centerX(), image.centerY()); return rToR && rot; }