Last active
August 29, 2015 13:56
-
-
Save pwittchen/9171526 to your computer and use it in GitHub Desktop.
Decode sampled bitmap from file path.
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
public static Bitmap decodeSampledBitmap(String filePath, int reqWidth, int reqHeight) { | |
final BitmapFactory.Options options = new BitmapFactory.Options(); | |
options.inJustDecodeBounds = true; | |
BitmapFactory.decodeFile(filePath,options); | |
options.inSampleSize = calculateInSampleSize(options, reqWidth, reqHeight); | |
options.inJustDecodeBounds = false; | |
return BitmapFactory.decodeFile(filePath,options); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment