user1118019
user1118019

Reputation: 3959

Android Reduce or Change Resolution of an Image Selected from Gallery in Android Phone

I have an application that lets users to choose pictures from their phone, once picture is selected, I want to make sure that the resolution of the picture is not too high (because my webserver does not accept high resolution pictures, i want them to be in hundred x hundred, say 999x999 is the highest resolution i can accept.)

so before loading, i need to change the resolution, but how do i do that in my Android code?

Please don't ask me to user a third party program like photoshop to change it. This is not about image size, because I can compress the image by 75%, but it won't work because the resolution is still high. I already tried such approach.

I just want to know how to, or even if there is a way, to change the resolution in code?

please help thanks

Upvotes: 1

Views: 7789

Answers (1)

lulumeya
lulumeya

Reputation: 1628

I think you can choose from various solutions. 1) using AQuery - that is simple, lightweight library supporting much convenience in android coding. 2) use BitmapFactory - using BitmapFactory.Options, you can decode file with downsampling, scaling...

Upvotes: 1

Related Questions