Ejemplo n.º 1
0
        protected override void OnActivityResult(int requestCode, Result result, Intent data)
        {
            base.OnActivityResult(requestCode, result, data);

            if (requestCode == LOAD_IMAGE && result == Result.Ok && imageReciever != null)
            {
                Android.Net.Uri imageUri = data.Data;
                Bitmap          bitmap;
                try
                {
                    bitmap = Android.Provider.MediaStore.Images.Media.GetBitmap(this.ContentResolver, imageUri);
                }
                catch (IOException e)
                {
                    System.Console.WriteLine("Activity Result Error " + e.Message + "\n");
                    return;
                }

                string encodedPath = imageUri.EncodedPath;

                imageReciever.receiveImage(bitmap,
                                           "" +
                                           System.Text.RegularExpressions.Regex.Replace(imageUri.EncodedPath, "[/\\:.$%-+*?]", "")
                                           + imageUri.GetHashCode());
                imageReciever = null;
            }
        }