1.设置预览方向myCamera.setDisplayOrientation(90)
2.设置照片方向parameters.setRotation(90);
3.设置预览显示和照片的分辨率
// 设置照片分辨率 List<Camera.Size> previewSizeList = parameters .getSupportedPreviewSizes(); int previewWidth = 0; int previewHeight = 0; for (int i = 0; i < previewSizeList.size() - 1; i++) { previewWidth = previewSizeList.get(i).width; previewHeight = previewSizeList.get(i).height; int nextWidth = previewSizeList.get(i + 1).width; int nextHeight = previewSizeList.get(i + 1).height; if (previewWidth < nextWidth) { previewWidth = nextWidth; } if (previewHeight < nextHeight) { previewHeight = nextHeight; } } previewWidth = previewWidth>previewSizeList.get(0).width?previewWidth:previewSizeList.get(0).width; previewHeight = previewHeight>previewSizeList.get(0).height?previewHeight:previewSizeList.get(0).height; parameters.setPreviewSize(previewWidth, previewHeight); List<Camera.Size> supportedPictureSizesList = parameters .getSupportedPictureSizes(); int supportedPictureWidth = 0; int supportedPictureHeight = 0; for (int i = 0; i < supportedPictureSizesList.size() - 1; i++) { supportedPictureWidth = supportedPictureSizesList.get(i).width; supportedPictureHeight = supportedPictureSizesList.get(i).height; int nextWidth = supportedPictureSizesList.get(i + 1).width; int nextHeight = supportedPictureSizesList.get(i + 1).height; if (supportedPictureWidth < nextWidth) { supportedPictureWidth = nextWidth; } if (supportedPictureHeight < nextHeight) { supportedPictureHeight = nextHeight; } } supportedPictureWidth = supportedPictureWidth>supportedPictureSizesList.get(0).width ?supportedPictureWidth:supportedPictureSizesList.get(0).width; supportedPictureHeight = supportedPictureHeight>supportedPictureSizesList.get(0).height ?supportedPictureHeight:supportedPictureSizesList.get(0).height; parameters .setPictureSize(supportedPictureWidth, supportedPictureHeight);
Android自定义照相机注意事项,布布扣,bubuko.com
原文:http://blog.csdn.net/android_farmer/article/details/24975819