为什么要从Android的相机中捕获模糊图像?

时间:2019-10-22 13:07:48

标签: android kotlin

  1. 我已经从相机捕获图像,但是图像变得模糊 onActivityResult。下面是我的代码,那是造成模糊图像的原因是什么?

    if(requestCode==
              Constants.PermissionRequestCodes.REQUEST_CODE_CAMERA
             {
               if (data != null) {
                if (!data.toString().equals("Intent {  }")) {
                    val thumbnail = data!!.extras!!.get("data")
                    val contentURI = 
                      MediaHelper.getImageUri(this,thumbnail as   Bitmap)
                    opnCropImageActivity(contentURI, 
                        requestCode,thumbnail as Bitmap)
                }
             }
       } 
    fun getImageUri(inContext: Context, inImage: Bitmap): Uri {
                val bytes = ByteArrayOutputStream()
                inImage.compress(Bitmap.CompressFormat.JPEG, 100, bytes)
                val path = MediaStore.Images.Media.insertImage(inContext.contentResolver,
    inImage, "Title", null)
                return Uri.parse(path)
            }
    

0 个答案:

没有答案