Java tutorial
//package com.java2s; import android.graphics.Bitmap; import android.graphics.Matrix; public class Main { public static Bitmap scaleImage(Bitmap bitmap, int destW, int destH) { if (bitmap == null) { return null; } int width = bitmap.getWidth(); int height = bitmap.getHeight(); float scaleWidth = ((float) destW) / width; float scaleHeight = ((float) destH) / height; Matrix matrix = new Matrix(); matrix.postScale(scaleWidth, scaleHeight); Bitmap scaledBitmap = Bitmap.createBitmap(bitmap, 0, 0, width, height, matrix, true); return scaledBitmap; } }