You can save the Bitmap object in the background, which you can change using this piece of code:
Matrix matrix = new Matrix(); matrix.postScale(scaledWidth, scaledHeight); Bitmap resizedBitmap = Bitmap.createBitmap(originalBitmap, 0, 0, originalBitmap.width(), originalBitmap.height(), matrix, true);
And save it later using this code:
OutputStream fOut = null; File file = new File(strDirectoy,imgname); fOut = new FileOutputStream(file); resizedBitmap.compress(Bitmap.CompressFormat.PNG, 0, fOut); fOut.flush(); fOut.close();
source share