Here you can find the source of resizePreviewBitmap(Bitmap bm, int width, int height)
public static Bitmap resizePreviewBitmap(Bitmap bm, int width, int height)
//package com.java2s; import android.graphics.Bitmap; public class Main { public static Bitmap resizePreviewBitmap(Bitmap bm, int width, int height) { try {/*from ww w.ja va2s . co m*/ if (bm != null) { Bitmap resizebm = Bitmap.createScaledBitmap(bm, width, height, true); return resizebm; } else { return null; } } catch (OutOfMemoryError e) { return null; } } }