我已经从相机捕获图像,但是图像变得模糊 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)
}