2015/10/13

Android 取得Camera 照片預覽及照片寬、高

實際與現實難免不符合
畢竟還是得看硬體支不支援XD

Code:
// 取得相機參數
   Camera.Parameters parameters = camera.getParameters();

   // 預覽尺寸清單
   List<Size> previewList = parameters.getSupportedPreviewSizes();
   for (Size s : previewList)
    Log.i("width,height", s.width + "," + s.height);

   // 照片尺寸清單
   List<Size> pictureList = parameters.getSupportedPictureSizes();
   for (Size s : pictureList)
    Log.i("width,height", s.width + "," + s.height);