Example usage for android.graphics Matrix Matrix

List of usage examples for android.graphics Matrix Matrix

Introduction

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

Prototype

public Matrix() 

Source Link

Document

Create an identity matrix

Usage

From source file:Main.java

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

From source file:Main.java

public static Bitmap rotateBitmap(Bitmap origin, float angle) {
    Matrix matrix = new Matrix();
    matrix.postRotate(angle);/* ww w .j ava  2s . com*/
    return Bitmap.createBitmap(origin, 0, 0, origin.getWidth(), origin.getHeight(), matrix, true);
}

From source file:Main.java

public static Bitmap zoom(Bitmap bitmap, float zf) {
    Matrix matrix = new Matrix();
    matrix.postScale(zf, zf);// ww w . j a  va  2s .  c o m
    return Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
}

From source file:Main.java

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

From source file:Main.java

private static Bitmap rotate(Bitmap result, int rotation) {
    Matrix matrix = new Matrix();
    matrix.setRotate(rotation, (float) result.getWidth() / 2, (float) result.getHeight() / 2);

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

From source file:Main.java

public static Bitmap rotateBitmap(Bitmap bmp, float degree) {
    Matrix matrix = new Matrix();
    matrix.postRotate(degree);//from  w w w .j  a v a2 s . c om
    return Bitmap.createBitmap(bmp, 0, 0, bmp.getWidth(), bmp.getHeight(), matrix, true);
}

From source file:Main.java

public static Bitmap zoomBitmap(float scale, Bitmap bitmap) {
    Matrix matrix = new Matrix();
    matrix.postScale(scale, scale);//w  w  w.java  2s .  co m
    Bitmap newBitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
    return newBitmap;
}

From source file:Main.java

public static Bitmap RotateBitmap(Bitmap source, float angle) {
    Matrix matrix = new Matrix();
    matrix.postRotate(angle);/* www . ja  v a 2s  .  c  o m*/
    return Bitmap.createBitmap(source, 0, 0, source.getWidth(), source.getHeight(), matrix, true);
}

From source file:Main.java

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

    Matrix mat = new Matrix();
    mat.postRotate(angle);/*from   w  ww .  j a  va  2  s . c  o m*/

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

}

From source file:Main.java

public static Bitmap rotateImage(int angle, Bitmap bitmap) {
    Matrix matrix = new Matrix();
    matrix.postRotate(angle);//from  w ww  . j av a 2s  .c o  m
    Bitmap resizedBitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix,
            true);
    return resizedBitmap;
}