Java tutorial
//package com.java2s; import android.graphics.*; public class Main { public static Bitmap cropBitmap(Bitmap source, int x, int y, int width, int height) { Bitmap bmp = Bitmap.createBitmap(source, x, y, width, height, null, false); if (source != null && bmp != source) { source.recycle(); } return bmp; } }