In fact, you can use Android BitmapRegionDecoder.decodeRegion() after creating an InputStream from Bitmap .
You can pass a Rect object to the decodeRegion method, for example:
BitmapRegionDecoder brd = BitmapRegionDecoder.newInstance(inputStream, true); Bitmap croppedBitmap = brd.decodeRegion(new Rect(left, top, right, bottom), null);
Greetings q :)
woot
source share