I know how to fetch gallery image and compress it and save to some another external directory but is it possible that when i compress some image and it get saved backed to it's original Directory and the old image gets deleted inside the gallery if yes then please provide some good link or sample i searched about it on net but not able to find anything.
Asked
Active
Viewed 32 times
0
-
You can see this link, may be it could help you. [link](http://stackoverflow.com/questions/10413659/how-to-resize-image-in-android) – Mayank Pandey Aug 17 '16 at 09:45
-
this link is just showing how to compressing the image which i know but i want to know how to replace compressed image with the original image , is it possible or not ? – kim jot Aug 17 '16 at 09:49
1 Answers
0
Again resize the compressed image and use it in place of compressed image.
Try:
Bitmap bitmap;
Bitmap resize = Bitmap.createScaledBitmap(bitmap, newWidth, newHeight, true);
or:
resize = Bitmap.createScaledBitmap(bitmap,(int)(bitmap.getWidth()*0.7), (int)(bitmap.getHeight()*0.7), true);

Mayank Pandey
- 79
- 1
- 13