Android Camera Set adjustCamera(Context context, Camera camera)

Here you can find the source of adjustCamera(Context context, Camera camera)

Description

adjust Camera

Declaration

public static void adjustCamera(Context context, Camera camera) 

Method Source Code

//package com.java2s;
import android.content.Context;

import android.content.res.Configuration;

import android.hardware.Camera;

public class Main {
    public static void adjustCamera(Context context, Camera camera) {
        if (context.getResources().getConfiguration().orientation != Configuration.ORIENTATION_LANDSCAPE) {
            //parameters.set("orientation","portrait");
            camera.setDisplayOrientation(90);
        } else {/* w  ww .j a v  a 2s . c  o  m*/
            //parameters.set("orientation","landscape");
            camera.setDisplayOrientation(0);
        }
    }
}

Related

  1. setMetering(Camera.Parameters parameters)
  2. setTorch(Camera.Parameters parameters, boolean on)
  3. setVideoStabilization(Camera.Parameters parameters)
  4. setZoom(Camera.Parameters parameters, double targetZoomRatio)
  5. getBackId()