Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.graphics.Bitmap;

import android.graphics.Matrix;

import java.lang.ref.WeakReference;

public class Main {

    public static WeakReference<Bitmap> rotateBitmap(WeakReference<Bitmap> bitmap, int degress) {
        if (bitmap == null || bitmap.get() == null)
            return null;
        Matrix m = new Matrix();
        m.postRotate(degress);
        return new WeakReference<Bitmap>(Bitmap.createBitmap(bitmap.get(), 0, 0, bitmap.get().getWidth(),
                bitmap.get().getHeight(), m, true));
    }
}