小编evg*_*eny的帖子

ACTION_IMAGE_CAPTURE 返回图像质量较差的位图,我在哪里可以获得高分辨率图像?

我希望高质量的图像显示ImageView并上传到服务器。我已经在 Internet、StackOverflow 和 GitHub 上搜索过,但找不到答案,也许有人知道如何解决?

protected void onActivityResult(int requestCode, int resultCode, Intent imageReturnedIntent) { //work android
    super.onActivityResult(requestCode, resultCode, imageReturnedIntent);
    imageReturnedIntent.putExtra(MediaStore.EXTRA_OUTPUT, uri);//try

    if (resultCode == RESULT_OK ) {// work every android than need click OK
      //working
        Uri selectedImage = imageReturnedIntent.getData();//convert to for bitmap that can send
        Bundle extras = imageReturnedIntent.getExtras();//finish converting and copy the image
        bitmap = extras.getParcelable("data");//receive image to bitmap
        imageView.setImageBitmap(bitmap);
Run Code Online (Sandbox Code Playgroud)

onCreate

btnCamera.setOnClickListener(new View.OnClickListener() {
        public void onClick(View view) {
            Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
            //intent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri); …
Run Code Online (Sandbox Code Playgroud)

android imageview android-camera android-camera-intent

1
推荐指数
1
解决办法
5093
查看次数