Skip to content

Instantly share code, notes, and snippets.

@cjoseanguiano
Created August 14, 2017 23:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cjoseanguiano/d39e11f16194da8afe51ff9fb4cab9cb to your computer and use it in GitHub Desktop.
Save cjoseanguiano/d39e11f16194da8afe51ff9fb4cab9cb to your computer and use it in GitHub Desktop.
BitmapImageSize.java
Bitmap bitmapImage = BitmapFactory.decodeFile(uri.getPath());
int nh = (int) (bitmapImage.getHeight() * (512.0 / bitmapImage.getWidth()));
Bitmap scaled = Bitmap.createScaledBitmap(bitmapImage, 512, nh, true);
mediaListRowHolder.thumbnail.setImageBitmap(scaled);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment