1

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 ?

1 Answer 1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.