I'm trying to reduce an Image resolution and to keep the same Image ratio, I'm just using the function create Scaled Bitmap.
Here is my code :
Bitmap bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), uri);
if (bitmap.getWidth() > 4096) bitmap = bitmap.createScaledBitmap(bitmap,bitmap.getWidth()/3,bitmap.getHeight()/3,true);
if (bitmap.getHeight() > 4096) bitmap = bitmap.createScaledBitmap(bitmap,bitmap.getWidth()/3,bitmap.getHeight()/3,true);
Is there any way to make it better ?
Thanks