Java tutorial
//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); } }