In any photo related Android application, flipping image is necessary feature. So here I wrote the code to flip the image in both horizontal as well as vertical direction.

Code for vertical flip bitmap:
Bitmap bInput/*your input bitmap*/, bOutput; Matrix matrix = new Matrix(); matrix.preScale(1.0f, -1.0f); bOutput = Bitmap.createBitmap(bInput, 0, 0, bInput.getWidth(), bInput.getHeight(), matrix, true);
Code for horizontal flip bitmap:
Bitmap bInput/*your input bitmap*/, bOutput; Matrix matrix = new Matrix(); matrix.preScale(-1.0f, 1.0f); bOutput = Bitmap.createBitmap(bInput, 0, 0, bInput.getWidth(), bInput.getHeight(), matrix, true);