Last active
August 29, 2015 14:17
-
-
Save AndrewWang1993/d90c78c2f461e9e36688 to your computer and use it in GitHub Desktop.
使用BitmapFactory对象测量一个图片的高和宽而不用分配内存
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 options = new BitmapFactory.Options(); | |
options.inJustDecodeBounds = true; // Don't allocated memory | |
BitmapFactory.decodeResource(getResources(), R.id.myimage, options); | |
int imageHeight = options.outHeight; | |
int imageWidth = options.outWidth; | |
String imageType = options.outMimeType; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment