Android Bitmap Resize resizePreviewBitmap(Bitmap bm, int width, int height)

Here you can find the source of resizePreviewBitmap(Bitmap bm, int width, int height)

Description

resize Preview Bitmap

Declaration

public static Bitmap resizePreviewBitmap(Bitmap bm, int width,
            int height) 

Method Source Code

//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;
        }
    }
}

Related

  1. resizeAndCropCenter(final Bitmap bitmap, final int size)
  2. resizeBitmap(Context context, int resId, int w, int h)
  3. resizeBitmapByScale(Bitmap bitmap, float scale, boolean recycle)
  4. resizeDownBySideLength(Bitmap bitmap, int maxLength, boolean recycle)
  5. resizeDrawable(Context context, int resId, int w, int h)
  6. smallImage(Bitmap bitmap, int Width, int Height)
  7. zoomBitmap(Bitmap bgimage, int newWidth, int newHeight)
  8. zoomBitmap(Bitmap bitmap, int width, int height)
  9. zoomBitmapAdjustScreen(Activity activity, String imagePath)