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;

import android.util.DisplayMetrics;

public class Main {
    /**
     * Get a mirror Bitmap
     *
     * @param sourceBitmap Bitmap to Change
     * @return Mirror bitmap
     */
    public static Bitmap getMirrorBitmap(Bitmap sourceBitmap) {
        Matrix m = new Matrix();
        m.preScale(-1, 1);
        Bitmap dst = Bitmap.createBitmap(sourceBitmap, 0, 0, sourceBitmap.getWidth(), sourceBitmap.getHeight(), m,
                false);
        dst.setDensity(DisplayMetrics.DENSITY_DEFAULT);
        return dst;
    }
}