2016-09-15

While taking picture from front camera, its shows preview like a mirror. Your left ear will be shown as right in camera preview. Referhow to take picture from Camera and SurfaceView for camera basics.

If you pic example from snapchat, they simply show picture same as like camera preview was showing. That feature looks good. User want the exact picture which one’s seeing in preview, if it translate it can completely change image/picture look.

When you capture bitmap from byte array, you can translate it back to what was showing in camera preview. Look at code below –

Matrix matrix = new Matrix();
if (face) { // reverse flipping of image should only need to be handle for front facing camera
matrix.preScale(1.0f, -1.0f);
}

Apply matrix to bitmap and create a new one –

See how to reverse flip video taken from front facing camera.

Show more