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);
give the same example for the image selected from gallery..
Hi, you can checkout the example of How to select image from gallery from here: https://acomputerengineer.wordpress.com/2015/07/04/pick-image-from-gallery-before-and-after-kitkat-version-in-android/
how can i apply both together