Created
April 29, 2014 02:07
-
-
Save CateyesLin/11389142 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BitmapFactory.Options opts = new BitmapFactory.Options(); | |
opts.inJustDecodeBounds = true; | |
BitmapFactory.decodeStream(is, null, opts); | |
... | |
opts.inSampleSize = ... | |
opts.inJustDecodeBounds = false; | |
... | |
is.reset(); //XXX Android 4.4 KitKat, Important! Without this, bmp will return null. | |
Bitmap bmp = BitmapFactory.decodeStream(is, null, opts); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment