Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.graphics.Bitmap;

import android.graphics.Matrix;

public class Main {
    public static Bitmap rotate(Bitmap originalBitmap, float alpha) {
        if (originalBitmap == null)
            return null;
        int width = originalBitmap.getWidth();
        int height = originalBitmap.getHeight();
        Matrix matrix = new Matrix();
        matrix.setRotate(alpha);
        return Bitmap.createBitmap(originalBitmap, 0, 0, width, height, matrix, true);
    }
}