Rotate Bitmap - Android Graphics

Android examples for Graphics:Bitmap Rotate

Description

Rotate Bitmap

Demo Code


//package com.java2s;

import android.graphics.Bitmap;

import android.graphics.Matrix;

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

Related Tutorials