Here you can find the source of resize(Bitmap bitmap, int newWidth, int newHeight)
Parameter | Description |
---|---|
bitmap | the bitmap |
newWidth | the new width |
newHeight | the new height |
public static Bitmap resize(Bitmap bitmap, int newWidth, int newHeight)
//package com.java2s; import android.graphics.Bitmap; public class Main { /**//from w ww .ja va 2s. c o m * Resize. * * @param bitmap * the bitmap * @param newWidth * the new width * @param newHeight * the new height * @return the bitmap */ public static Bitmap resize(Bitmap bitmap, int newWidth, int newHeight) { Bitmap resizedBitmap = Bitmap.createBitmap(bitmap, 0, 0, newWidth, newHeight); // make a Drawable from Bitmap to allow to set the BitMap // to the ImageView, ImageButton or what ever return resizedBitmap; } }