bitmap bad quality after set to imageview

后端 未结 2 1739
遥遥无期
遥遥无期 2020-12-22 12:26

I am creating a app that opens camera for user and after image captured it will be shows on ImageView! But the image in ImageView has very bad quality
here is the code:

2条回答
  •  天涯浪人
    2020-12-22 12:41

    Use something other than the thumbnail. Quoting the documentation for ACTION_IMAGE_CAPTURE, with emphasis added:

    The caller may pass an extra EXTRA_OUTPUT to control where this image will be written. If the EXTRA_OUTPUT is not present, then a small sized image is returned as a Bitmap object in the extra field. This is useful for applications that only need a small image. If the EXTRA_OUTPUT is present, then the full-sized image will be written to the Uri value of EXTRA_OUTPUT.

    So, specify a Uri in EXTRA_OUTPUT where a full camera image should be written to. Then, use an image-loading library, like Picasso, to load the photo into your ImageView.

    Here is a sample app that demonstrates using EXTRA_OUTPUT.

提交回复
热议问题