本文整理了Java中android.hardware.Camera.startSmoothZoom()
方法的一些代码示例,展示了Camera.startSmoothZoom()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Camera.startSmoothZoom()
方法的具体详情如下:
包路径:android.hardware.Camera
类名称:Camera
方法名:startSmoothZoom
暂无
代码示例来源:origin: zxfnicholas/CameraSDK
private void addZoomIn(int delta) {
try {
Camera.Parameters params = cameraInst.getParameters();
Log.d("Camera", "Is support Zoom " + params.isZoomSupported());
if (!params.isZoomSupported()) {
return;
}
curZoomValue += delta;
if (curZoomValue < 0) {
curZoomValue = 0;
} else if (curZoomValue > params.getMaxZoom()) {
curZoomValue = params.getMaxZoom();
}
if (!params.isSmoothZoomSupported()) {
params.setZoom(curZoomValue);
cameraInst.setParameters(params);
return;
} else {
cameraInst.startSmoothZoom(curZoomValue);
}
} catch (Exception e) {
e.printStackTrace();
}
}
代码示例来源:origin: Yuphee/RecordVideo
/**
* 放大预览视图
*/
private void zoomPreview() {
Camera.Parameters parameters = mCamera.getParameters();
int currentZoom = parameters.getZoom();
int maxZoom = (int) (parameters.getMaxZoom() / 2f + 0.5);
int destZoom = 0 == currentZoom ? maxZoom : 0;
if (parameters.isSmoothZoomSupported()) {
mCamera.stopSmoothZoom();
mCamera.startSmoothZoom(destZoom);
} else {
Handler handler = getHandler();
if (null == handler)
return;
handler.removeCallbacks(mZoomRunnable);
handler.post(mZoomRunnable = new ZoomRunnable(destZoom, currentZoom, mCamera));
}
}
代码示例来源:origin: ysq1051838264/CustomCamera
private void addZoomIn(int delta) {
try {
Camera.Parameters params = mCamera.getParameters();
Log.d("Camera", "Is support Zoom " + params.isZoomSupported());
if (!params.isZoomSupported()) {
return;
}
curZoomValue += delta;
if (curZoomValue < 0) {
curZoomValue = 0;
} else if (curZoomValue > params.getMaxZoom()) {
curZoomValue = params.getMaxZoom();
}
if (!params.isSmoothZoomSupported()) {
params.setZoom(curZoomValue);
mCamera.setParameters(params);
return;
} else {
mCamera.startSmoothZoom(curZoomValue);
}
} catch (Exception e) {
e.printStackTrace();
}
}
内容来源于网络,如有侵权,请联系作者删除!