I am selecting image from a gallery.
This is the code which i am using
Intent intent = new Intent();
intent.SetType("image/*");
intent.SetAction(Intent.ActionGetContent);
this.StartActivityForResult(Intent.CreateChooser(intent,
"Select Picture"), SelectPicture);
I am getting this string in data.DataString
content://media/external/images/media/11
on Activty result..
Which is not a full path to the selected Image. But ultimately i want to convert it to bitmap.
In activity result..
protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
Bitmap bitmap = (Android.Graphics.Bitmap)data.Extras.Get("data");
Gives null error.
How ever instead of selecting image from the gallery when i capture image from camera it works fine and i get the bitmap. Code i am using:
var cameraIntent = new Intent(MediaStore.ActionImageCapture);
cameraIntent.PutExtra(MediaStore.ExtraOutput, imageUri);
this.StartActivityForResult(cameraIntent, TakePicture);