Here you can find the source of getScaledBitmapByHeight(Bitmap bm, int newHeight)
public static Bitmap getScaledBitmapByHeight(Bitmap bm, int newHeight)
//package com.java2s; import android.graphics.Bitmap; public class Main { public static Bitmap getScaledBitmapByHeight(Bitmap bm, int newHeight) { int width = bm.getWidth(); int height = bm.getHeight(); int newWidth = (width * newHeight) / height; Bitmap scaledBitmap = Bitmap.createScaledBitmap(bm, newWidth, newHeight, false);/* ww w . j a va2s . c o m*/ bm.recycle(); return scaledBitmap; } }