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 {
    public static Bitmap getResizedBitmap(Bitmap bitmap, int i, int j) {
        int k = bitmap.getWidth();
        int l = bitmap.getHeight();
        float f = (float) i / (float) k;
        float f1 = (float) j / (float) l;
        Matrix matrix = new Matrix();
        matrix.postScale(f, f1);
        return Bitmap.createBitmap(bitmap, 0, 0, k, l, matrix, false);
    }
}