Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.graphics.*;

public class Main {
    public static Bitmap scale(Bitmap org, float xRate, float yRate) {

        final int orgWidth = org.getWidth();
        final int orgHeight = org.getHeight();

        Matrix matrix = new Matrix();
        matrix.postScale(xRate, yRate);

        return Bitmap.createBitmap(org, 0, 0, orgWidth, orgHeight, matrix, true);
    }
}