Java tutorial
//package com.java2s; import android.graphics.Bitmap; import android.view.View; public class Main { public static Bitmap crop(Bitmap srcBmp, View canvasView, int downsampling) { float scale = 1f / downsampling; return Bitmap.createBitmap(srcBmp, (int) Math.floor((canvasView.getX()) * scale), (int) Math.floor((canvasView.getY()) * scale), (int) Math.floor((canvasView.getWidth()) * scale), (int) Math.floor((canvasView.getHeight()) * scale)); } }