do Rotate with Matrix - Android Graphics

Android examples for Graphics:Bitmap Rotate

Description

do Rotate with Matrix

Demo Code


//package com.java2s;
import android.graphics.Bitmap;

import android.graphics.Matrix;

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

Related Tutorials