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;

public class Main {
    public static Bitmap fixRotateMirrorImage(Bitmap src) {
        Matrix rotateRight = new Matrix();
        float[] mirrorY = { -1, 0, 0, 0, 1, 0, 0, 0, 1 };
        Matrix matrixMirrorY = new Matrix();
        matrixMirrorY.setValues(mirrorY);
        rotateRight.postConcat(matrixMirrorY);
        rotateRight.preRotate(270);
        final Bitmap rotMirrorImg = Bitmap.createBitmap(src, 0, 0, src.getWidth(), src.getHeight(), rotateRight,
                true);
        src.recycle();

        return rotMirrorImg;
    }
}