I'm trying to build an app, that captures a picture and sends the picture to another activity. I'm trying to display this picture in the second activity and apparently the quality of picture is very low.
Here is my code so far
Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, PICTURE_TAKEN);
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(resultCode == RESULT_OK){
Intent canvasIntent = new Intent(this ,canvas.class);
Bundle extras = data.getExtras();
bmpCameraResult = (Bitmap)extras.get("data");
canvasIntent.putExtra("bmp_Image", bmpCameraResult);
startActivity(canvasIntent);
}
and in the canvasActivity, I'm trying to receive the bitmap in the conventional fashion and trying to display it.
Intent intent= getIntent();
Bitmap bmp = (Bitmap) intent.getParcelableExtra("bmp_Image");
ImageView iv = new ImageView(this);
iv.setImageBitmap(bmp);
setContentView(iv);
What could be the reason for this reduction of quality? What is the optimized way of getting the high quality image?
Thank You.