android相机固定焦距,Android Camera变焦编程步骤
public void setZoom(){if (mIsSupportZoom){try{Parameters params = mCamera.getParameters();final int MAX = params.getMaxZoom();if(MAX==0)return;int zoomValue = params.getZoom();Trace.Log("-------------
·
public void setZoom()
{
if (mIsSupportZoom)
{
try
{
Parameters params = mCamera.getParameters();
final int MAX = params.getMaxZoom();
if(MAX==0)return;
int zoomValue = params.getZoom();
Trace.Log("-----------------MAX:"+MAX+" params : "+zoomValue);
zoomValue += 5;
params.setZoom(zoomValue);
mCamera.setParameters(params);
Trace.Log("Is support Zoom " + params.isZoomSupported());
}
catch (Exception e)
{
Trace.Log("--------exception zoom");
e.printStackTrace();
}
}
else
{
Trace.Log("--------the phone not support zoom");
}
}
更多推荐
已为社区贡献4条内容
所有评论(0)