Example usage for android.graphics Matrix postRotate

List of usage examples for android.graphics Matrix postRotate

Introduction

In this page you can find the example usage for android.graphics Matrix postRotate.

Prototype

public boolean postRotate(float degrees) 

Source Link

Document

Postconcats the matrix with the specified rotation.

Usage

From source file:Main.java

public static Bitmap rotaingBitmap(float degree, Bitmap bitmap) {
    Matrix matrix = new Matrix();
    matrix.postRotate(degree);
    return Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
}

From source file:Main.java

public static Bitmap rotateBitmap(Bitmap bitmap, float angle) {
    Matrix matrix = new Matrix();
    matrix.postRotate(angle);
    return Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
}

From source file:Main.java

public static Bitmap doRotate(Bitmap b, float angle) {
    Matrix matrix = new Matrix();
    matrix.postRotate(angle);
    b = Bitmap.createBitmap(b, 0, 0, b.getWidth(), b.getHeight(), matrix, true);
    return b;//  w w  w  .j a v  a 2 s .c om
}

From source file:Main.java

public static Bitmap getRotateBitmap(Bitmap b, float rotateDegree) {
    Matrix matrix = new Matrix();
    matrix.postRotate((float) rotateDegree);
    Bitmap rotaBitmap = Bitmap.createBitmap(b, 0, 0, b.getWidth(), b.getHeight(), matrix, false);
    return rotaBitmap;
}

From source file:Main.java

public static Bitmap rotate(Bitmap bitmap, int degree) {
    int w = bitmap.getWidth();
    int h = bitmap.getHeight();
    Matrix mtx = new Matrix();
    mtx.postRotate(degree);
    return Bitmap.createBitmap(bitmap, 0, 0, w, h, mtx, true);
}

From source file:Main.java

public static Bitmap rotateBitmap(Bitmap bitmap) {

    Matrix matrix = new Matrix();
    matrix.postRotate(90f);

    return Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
}

From source file:Main.java

public static Bitmap rotateBmp(Bitmap bmp, int degree) {
    int w = bmp.getWidth();
    int h = bmp.getHeight();
    Matrix mtx = new Matrix();
    mtx.postRotate(degree);
    Bitmap rotatedBMP = Bitmap.createBitmap(bmp, 0, 0, w, h, mtx, true);
    return rotatedBMP;
}

From source file:Main.java

public static Bitmap imageRotate(Bitmap bitmap, int angle) {

    Matrix mat = new Matrix();
    mat.postRotate(angle);

    return Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), mat, true);

}

From source file:Main.java

public static Bitmap rotate(int rotateDegree, Bitmap originalBitmap) {
    Matrix matrix = new Matrix();
    matrix.postRotate(rotateDegree);
    Bitmap rotateBitmap = Bitmap.createBitmap(originalBitmap, 0, 0, originalBitmap.getWidth(),
            originalBitmap.getHeight(), matrix, true);
    return rotateBitmap;
}

From source file:Main.java

private static Bitmap rotaingImageView(int angle, Bitmap bitmap) {
    Matrix matrix = new Matrix();
    matrix.postRotate(angle);
    Bitmap resizedBitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix,
            true);//from   w ww.j  a v  a2  s .co  m
    return resizedBitmap;
}