get Inverse Bitmap - Android Graphics

Android examples for Graphics:Bitmap Color

Description

get Inverse Bitmap

Demo Code


//package com.java2s;

import android.graphics.Bitmap;

import android.graphics.Matrix;

public class Main {

    public static Bitmap getInverseBitmap(Bitmap mBitmap) {
        int width = mBitmap.getWidth();
        int height = mBitmap.getHeight();

        Matrix matrix = new Matrix();
        matrix.preScale(1, -1);//from ww  w  . j av a2 s  .  com
        Bitmap mInverseBitmap = Bitmap.createBitmap(mBitmap, 0, 0, width,
                height, matrix, false);

        return mInverseBitmap;
    }
}

Related Tutorials