I have Uri of some image at my external storage but it is too large. I have constructor further which accepts only File like parameter. How to make picture smaller adn get File from that ?
Asked
Active
Viewed 246 times
1 Answers
0
Well that depends on how you're displaying the picture. If you're simply going to show that picture in your layout, just size the ImageView element appropriately in your respective layout.xml file:
android:minHeight="your_value"
android:minWidth="your_value"
Also, don't forget to set the adjustViewBounds property as well:
android:adjustViewBounds="true"
If you're looking for something a bit more robust and you're concerned about the memory used to store the entire bitmap for display, then I'd look into using the BitmapFactory class and specifically the inSampleSize field.
This previous question also provides some background for you.

Community
- 1
- 1

Mat Nadrofsky
- 8,289
- 8
- 49
- 73