Here you can find the source of smallImage(Bitmap bitmap, int Width, int Height)
public static Bitmap smallImage(Bitmap bitmap, int Width, int Height)
//package com.java2s; import android.graphics.Bitmap; import android.graphics.Matrix; public class Main { public static Bitmap smallImage(Bitmap bitmap, int Width, int Height) { int oldWidth = bitmap.getWidth(); int oldHeight = bitmap.getHeight(); float scaleWidth = ((float) Width) / oldWidth; float scaleHeight = ((float) Height) / oldHeight; Matrix matrix = new Matrix(); matrix.postScale(scaleWidth, scaleHeight); return Bitmap.createBitmap(bitmap, 0, 0, oldWidth, oldHeight, matrix, true);//from ww w .j a va 2 s . c om } }