android 拍照获得的照片太小太娇气 的 解决方法
16lz
2021-01-26
http://gqdy365.iteye.com/blog/1520173
http://www.devdiv.com/android_%E6%8B%8D%E7%85%A7%E8%8E%B7%E5%BE%97%E7%9A%84%E7%85%A7%E7%89%87%E5%A4%AA%E5%B0%8F%E5%A4%AA%E5%A8%87%E6%B0%94_%E7%9A%84_%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95-weblog-186998-8732.html
好用
http://www.devdiv.com/android_%E6%8B%8D%E7%85%A7%E8%8E%B7%E5%BE%97%E7%9A%84%E7%85%A7%E7%89%87%E5%A4%AA%E5%B0%8F%E5%A4%AA%E5%A8%87%E6%B0%94_%E7%9A%84_%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95-weblog-186998-8732.html
private String newCapturePhotoPath ;private void openCamera(){ Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); //用日期作为文件名,确保唯一性 Date date = new Date(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss"); //拍完照片之后保存的路径(文件名) newCapturePhotoPath = 文件夹路径+ "/+"+ formatter.format(date) + ".jpg"; //加上这个后,图片就不会被压缩变小了 intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(newCapturePhotoPath))); startActivityForResult(intent, 0);}// 拍照结束后执行@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data){ //拍照后 点击确认 result==-1 ,点击取消result==0 if (resultCode == -1) { //newCapturePhotoPath即为刚刚拍到的照片的地址,你可以为所欲为了 }}
好用
更多相关文章
- Xamarin Android基本功能实现
- Android(安卓)Package Name vs. Application ID
- Android(安卓)模拟器运行编译后的源码
- Android项目集成Jenkins(JUnit test & Coverage)
- Android(安卓)数据存储——上
- Android(安卓)FileUtil
- 解决Eclipse提示错误:Your project contains error(s)
- android数据库(随apk一起发布数据库)
- Bip44确定性算法的android实现