Created
June 7, 2014 20:39
-
-
Save nalitzis/d4fdbf768d457ee16ce9 to your computer and use it in GitHub Desktop.
Bitmap info
This file contains hidden or 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
private void readBitmapInfo() { | |
final Resources res = getActivity().getResources(); | |
final BitmapFactory.Options options = new BitmapFactory.Options(); | |
options.inJustDecodeBounds = true; | |
BitmapFactory.decodeResource(res, R.drawable.brasil, options); | |
final float imageHeight = options.outHeight; | |
final float imageWidth = options.outWidth; | |
final String imageMimeType = options.outMimeType; | |
Log.d(TAG, "w,h, type:"+imageWidth+", "+imageHeight+", "+imageMimeType); | |
Log.d(TAG, "estimated memory required in MB: "+imageWidth * imageHeight * BYTES_PER_PX/MemUtils.BYTES_IN_MB); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment