I followed the instructions below to crop an image.
http://coderzheaven.com/index.php/2011/03/crop-an-image-in-android/
The height and width of the final cro
//solution for bit map resizing
Bitmap targetBitmap = Bitmap.createBitmap(targetWidth, targetHeight,Bitmap.Config.ARGB_8888);
RectF rectf = new RectF(0, 0, 800, 400);
Canvas canvas = new Canvas(targetBitmap);
Path path = new Path();
path.addRect(rectf, Path.Direction.CW);
canvas.clipPath(path);
int xaxis=bm.getWidth();
int yaxis=bm.getHeight();
canvas.drawBitmap( bm, new Rect(0, 0, bm.getWidth(), bm.getHeight()),
new Rect(0, 0, targetWidth, targetHeight), paint);
Matrix matrix = new Matrix();
matrix.postScale(1f, 1f);
resizedBitmap = Bitmap.createBitmap(targetBitmap, 0, 0, width, height, matrix, true);
BitmapDrawable bd = new BitmapDrawable(resizedBitmap);