本文整理汇总了Java中android.hardware.Camera.Parameters.setSceneMode方法的典型用法代码示例。如果您正苦于以下问题:Java Parameters.setSceneMode方法的具体用法?Java Parameters.setSceneMode怎么用?Java Parameters.setSceneMode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.hardware.Camera.Parameters
的用法示例。
在下文中一共展示了Parameters.setSceneMode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setSceneMode
import android.hardware.Camera.Parameters; //导入方法依赖的package包/类
@UiThread
private Parameters setSceneMode(Camera camera, Parameters params) {
List<String> sceneModes = params.getSupportedSceneModes();
if (sceneModes == null) return params;
if (LOG.isLoggable(INFO)) LOG.info("Scene modes: " + sceneModes);
if (sceneModes.contains(SCENE_MODE_BARCODE)) {
params.setSceneMode(SCENE_MODE_BARCODE);
camera.setParameters(params);
return camera.getParameters();
}
return params;
}
示例2: setCamera
import android.hardware.Camera.Parameters; //导入方法依赖的package包/类
public void setCamera(Camera camera) {
mCamera = camera;
if (mCamera != null) {
Parameters parameters = mCamera.getParameters();
mSupportedPreviewSizes = parameters.getSupportedPreviewSizes();
List<Integer> formatsList = parameters.getSupportedPreviewFormats(); //get supported preview formats
if(formatsList.contains(ImageFormat.NV21)) { // formatsList is always not null.
parameters.setPreviewFormat(ImageFormat.NV21); //set preview format is NV21,default is NV21 (yuv420sp)
}
// Set Focus mode depending on what is supported. MODE_AUTO is
// preferred mode.
// need not to test supported mode coz it has been tested in main activity.
if (msnFocusMode == 2) {
parameters.setFocusMode( Camera.Parameters.FOCUS_MODE_INFINITY );
} else if (msnFocusMode == 1) {
parameters.setFocusMode( Camera.Parameters.FOCUS_MODE_FIXED );
} else {
// set to auto focus by default
parameters.setFocusMode( Camera.Parameters.FOCUS_MODE_AUTO);
}
/*if ((parameters.getMaxExposureCompensation() != 0 || parameters.getMinExposureCompensation() != 0)
&& ActivitySettings.msnPhotoTakenFrom == 1) { // screen mode.
parameters.setExposureCompensation(parameters.getMaxExposureCompensation());
} */
parameters.setExposureCompensation(0); // exposure is not adjusted. Seems that screen mode does not bring much benefit.
List<String> scenesList = parameters.getSupportedSceneModes();
if (scenesList != null && scenesList.contains(Camera.Parameters.SCENE_MODE_STEADYPHOTO)) {
parameters.setSceneMode(Camera.Parameters.SCENE_MODE_STEADYPHOTO); // this may crash in some devices.
}
boolean bSuccessful = setCameraParams(mCamera, parameters);
requestLayout();
}
}
示例3: disableSceneMode
import android.hardware.Camera.Parameters; //导入方法依赖的package包/类
@UiThread
private Parameters disableSceneMode(Camera camera, Parameters params) {
params.setSceneMode(SCENE_MODE_AUTO);
camera.setParameters(params);
return camera.getParameters();
}