Java tutorial
//package com.java2s; //License from project: LGPL import android.graphics.Bitmap; import android.graphics.BitmapFactory; import java.io.InputStream; public class Main { public static Bitmap scaleToStretchBitmap(Bitmap dst, InputStream is) { Bitmap src = BitmapFactory.decodeStream(is); return Bitmap.createScaledBitmap(src, dst.getWidth(), dst.getHeight(), true); } public static Bitmap scaleToStretchBitmap(Bitmap dst, byte[] byImage) { Bitmap src = BitmapFactory.decodeByteArray(byImage, 0, byImage.length); return Bitmap.createScaledBitmap(src, dst.getWidth(), dst.getHeight(), true); } }