i'm using ZXing 3.1.0 and i want to rotate camera library to scan, after reading this topic and this
I attempted to paste camera.setDisplayOrientation(90);
in setDesiredCameraParameters
method for rotate camera but i get this error
Error:(77, 11) java: cannot find symbol
symbol: method setDisplayOrientation(int)
location: variable camera of type android.hardware.Camera
setDesiredCameraParameters
method is now:
void setDesiredCameraParameters(Camera camera) {
Camera.Parameters parameters = camera.getParameters();
parameters.set("orientation", "portrait");
camera.setDisplayOrientation(90);
if (parameters == null) {
Log.w(TAG, "Device error: no camera parameters are available. Proceeding without configuration.");
return;
}
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
initializeTorch(parameters, prefs);
String focusMode = findSettableValue(parameters.getSupportedFocusModes(),
Camera.Parameters.FOCUS_MODE_AUTO,
Camera.Parameters.FOCUS_MODE_MACRO);
if (focusMode != null) {
parameters.setFocusMode(focusMode);
}
parameters.setPreviewSize(cameraResolution.x, cameraResolution.y);
camera.setParameters(parameters);
}