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 {
    /**
     * reversal bitmap at left-right
     * 
     * @param originalImage
     * @return the bitmap after reversal
     */
    public static Bitmap createReversal(Bitmap originalImage) {
        int width = originalImage.getWidth();
        int height = originalImage.getHeight();

        Matrix matrix = new Matrix();
        matrix.preScale(-1.0f, 1.0f);

        return Bitmap.createBitmap(originalImage, 0, 0, width, height, matrix, false);
    }
}