Last active
July 18, 2016 09:35
-
-
Save mzlogin/843f5eb9c4c0f5282d69a0751c212b2c to your computer and use it in GitHub Desktop.
Get image size without load image to memory in Android.
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 opt = new BitmapFactory.Options(); | |
opt.inJustDecodeBounds = true; | |
BitmapFactory.decodeResource(context.getResources(), R.drawable.demo_img, opt); | |
int width = opt.outWidth; | |
int height = opt.outHeight; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment