从. _ BitmapRegionDecoder.decodeRegion()
_InputStream
Bitmap
您可以像这样将Rect
对象传递给decodeRegion
方法:
BitmapRegionDecoder brd = BitmapRegionDecoder.newInstance(inputStream, true);
Bitmap croppedBitmap = brd.decodeRegion(new Rect(left, top, right, bottom), null);
干杯q:)