How to return the inverted image from the front camera in Android?

I can’t understand a couple of days how to solve my inverted picture from the front camera on Android 4.

I want to turn them along this path, but for some reason the android does not detect the rules for the front camera and OS version.

    public static float getDegree(int exifOrientation) {
    if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_90)
        return 180;
    else if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_180)
        return 270;
    else if (exifOrientation == ExifInterface.ORIENTATION_ROTATE_270)
        return 0;

    Camera.CameraInfo info = new Camera.CameraInfo();
    android.hardware.Camera.getCameraInfo(0, info);
    if (android.os.Build.VERSION.SDK_INT>13 && info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT)
    {
        return 270;
    }
    else {
        return 90;
    }

Any suggestions?

+4
source share
1 answer

Create two arrays: one that contains data for vertical lines and one for temporary data (they should be the same size). Then create a loop in which you start with the length of the first array and go to 0. At each iteration, add data from this array of vertical lines to another. Then just convert the temporary array to an image if you want.

0

All Articles