图像清晰度差的Android相机

时间:2016-11-17 05:38:29

标签: android bitmap camera

我正在使用此代码...

   iv.setOnClickListener(new View.OnClickListener() {


            @Override
            public void onClick(View v) {

                Intent cameraIntent ;

                    cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
                    startActivityForResult(cameraIntent, CAMERA_REQUEST);


            }
        });

      public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (requestCode == CAMERA_REQUEST && resultCode == Activity.RESULT_OK) {
            Bitmap picture = (Bitmap) data.getExtras().get("data");

            iv.setImageBitmap(picture); 
        }
}

存储到位图的图像清晰度很差。只有4kb。如何提高图像的清晰度?

1 个答案:

答案 0 :(得分:0)

你有没有尝试过这一行

 cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI);

请参阅官方文档HERE