¡@

Home 

2014/10/16 ¤W¤È 08:19:26

android Programming Glossary: minsidelength

How to overcome this error:java.lang.OutOfMemoryError: bitmap size exceeds VM budget

http://stackoverflow.com/questions/7606846/how-to-overcome-this-errorjava-lang-outofmemoryerror-bitmap-size-exceeds-vm-bu

here is the same you use in step 1. private static int computeInitialSampleSize BitmapFactory.Options options int minSideLength int maxNumOfPixels double w options.outWidth double h options.outHeight int lowerBound maxNumOfPixels IImage.UNCONSTRAINED.. int lowerBound maxNumOfPixels IImage.UNCONSTRAINED 1 int Math.ceil Math.sqrt w h maxNumOfPixels int upperBound minSideLength IImage.UNCONSTRAINED 128 int Math.min Math.floor w minSideLength Math.floor h minSideLength if upperBound lowerBound return.. Math.sqrt w h maxNumOfPixels int upperBound minSideLength IImage.UNCONSTRAINED 128 int Math.min Math.floor w minSideLength Math.floor h minSideLength if upperBound lowerBound return the larger one when there is no overlapping zone. return lowerBound..