PhuongFuk PhuongFuk - 5 months ago 14
Android Question

How much size of file can be pass by Intent in Android?

I have problem with

intent
in
android
. I use
intent
transfer image have been made by camera (camera of device) to
bitmap
, and then I show it. But it's too small. My camera is 8mpx.
so why and how can I fix it?

Answer

Could you be more specific, Is the photo taken directly from camera or selected from gallery? Most probably the size of the imageView itself is small. A photo no matter how small can be enlarged to fit a large imageView but it will pixelate.

If you have its URI you could try this code to convert data from intent to uri which then gets converted to bitmap and then assigned to your imageView

Uri imageUri = intent.getData();
Bitmap bitmap =     MediaStore.Images.Media.getBitmap(this.getContentResolver(),imageUri);
Imageview imgview1 = (Imageview ) findViewById (R.id.imgview1);
imgeview1.setImageBitmap(bitmap);

You could use the above code to convert URI recieved from camera to a bitmap and assign it to the imageView. If the image still looks small then check the size of the imageView.

Comments