2013-03-20 62 views

回答

0

您可以使用BitmapRegionDecoder來獲取要放大的圖像區域並將其顯示在單獨的視圖中。

ByteArrayOutputStream stream = new ByteArrayOutputStream(); 
yourImageBitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream); 

byte[] bmpArray = stream.toByteArray(); 
BitmapRegionDecoder decoder = BitmapRegionDecoder.newInstance(bmpArray, 0, bmpArray.length, false); 
Bitmap region = decoder.decodeRegion(new Rect(leftCoordinate, topCoordinate, rightCoordinate, bottomCoordinate), null); 

這可能會解決您的問題