改进
自动对焦设置
在onPreView函数中添加以下代码:
public void onPreviewFrame(byte[] bytes, Camera camera) {
camera.autoFocus(null); //auto focus add by xxx
if (canTake) {
getSurfacePic(bytes, camera);
canTake = false;
}
}
在openFrontFacingCameraGingerbread函数中,return cam之前添加以下代码:
cam.getParameters().setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO); //auto focus add by xxx