首页 > 网站 > 建站经验 > 正文

android 相机报错 setParamet_ers failed

2019-11-02 15:03:25
字体:
来源:转载
供稿:网友

   List sizeList = parameters.getSupportedPreviewSizes();

  int PreviewWidth = 640;

  int PreviewHeight = 480;

  

格瓦拉电影网[www.aikan.tv/special/gewaladianyingwang/]
Boolean findSize = false;

  if (sizeList.size() > 1) {

  Iterator itor = sizeList.iterator();

  while (itor.hasNext()) {

  Camera.Size cur = itor.next();

  if (cur.width >= PreviewWidth

  && cur.height >= PreviewHeight) {

  findSize = true;

  PreviewWidth = cur.width;

  PreviewHeight = cur.height;

  break;

  }

  }

  }

  if (!findSize) {

  PreviewWidth = sizeList.get(0).width;

  PreviewHeight = sizeList.get(0).height;

  }

  parameters.setPreviewSize(PreviewWidth, PreviewHeight);

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表