get Skew Bitmap - Android Graphics

Android examples for Graphics:Bitmap Transform

Description

get Skew Bitmap

Demo Code


//package com.java2s;

import android.graphics.Bitmap;

import android.graphics.Matrix;

public class Main {

    public static Bitmap getSkewBitmap(Bitmap mBitmap, float xRatio,
            float yRatio) {
        int width = mBitmap.getWidth();
        int height = mBitmap.getHeight();

        Matrix matrix = new Matrix();
        matrix.postSkew(xRatio, yRatio);
        Bitmap mScrewBitmap = Bitmap.createBitmap(mBitmap, 0, 0, width,
                height, matrix, true);//from ww w  .j  ava  2 s.  co m

        return mScrewBitmap;
    }
}

Related Tutorials