Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

public class Main {
    public static Bitmap decodeSampledBitmapFromFile(String path, int requiredWidth, int requiredHeight) {
        if (path == null) {
            return null;
        }
        Bitmap bmp = BitmapFactory.decodeFile(path, null);
        return Bitmap.createScaledBitmap(bmp, requiredWidth, requiredHeight, true);
    }
}