title: How do I grab an Image or bitmap from the android camera using c#
body: <p>I am able to get the image using the code below. After snapping the shot I want to turn the image into a <code>byte[]</code>.  The thing I am stuck on is how am I supposed to grab the image after taking the picture?</p>
  
  <p><code>Intent</code> is the intent I use to open the camera but I am not sure if there is something I can override or if the Intent still has my <code>image/bitmap</code> so I can break it down.</p>
  
  <pre><code>[Activity(Label = "CameraPage")]
  public class PhotoTaker : Activity
  {
      protected override void OnCreate(Bundle bundle)
      {
          base.OnCreate(bundle);
  
         SetContentView(Resource.Layout.CameraView);
          ImageButton button = FindViewById&lt;ImageButton&gt;(Resource.Id.imagebutton);
          button.Click += BtnCameraClick;
      }
      private string _imageUri;
      private Intent intent;
  
  
      private Boolean isMounted
      {
          get
          {
              return Android.OS.Environment.ExternalStorageState.Equals(Android.OS.Environment.MediaMounted);
          }
      }
  
      public void BtnCameraClick(object sender, EventArgs eventArgs)
      {
          var uri = ContentResolver.Insert(isMounted
                                               ? MediaStore.Images.Media.ExternalContentUri
                                               : MediaStore.Images.Media.InternalContentUri, new ContentValues());
          _imageUri = uri.ToString();
          intent = new Intent(MediaStore.ActionImageCapture);
          //bitmap = MediaStore.Images.Media.GetBitmap(ContentResolver, uri);
          intent.PutExtra(MediaStore.ExtraOutput, uri);
          StartActivityForResult(intent, 1001);
      }
  
      protected override void OnActivityResult(int requestCode, Result resultCode, Intent data)
      {
          if (resultCode == Result.Ok &amp;&amp; requestCode == 1001)
          {
              Toast.MakeText(this, string.Format("Image URI is {0}", _imageUri), ToastLength.Short).Show();
              Android.Content.Intent temp = new Intent(this, typeof(PayeeInformationViewModel));
              StartActivity(temp);
              //this.byteArr = this.bitmap.GetNinePatchChunk();
            //  byteArr = intent.GetByteArrayExtra(_imageUri);
            //  GetFileStreamPath(this._imageUri);
              //var firstArr = string.Empty;
              //if (byteArr.Length &gt; 5)
              //{
              //    foreach (byte b in byteArr)
              //    {
              //        firstArr += b.ToString();
              //        if (firstArr.Length &gt; 5)
              //        {
              //            break;
              //        }
              //    }
              //}
              //else
              //{
              //    firstArr = "Small";
              //}
            //  Toast.MakeText(this, firstArr, ToastLength.Short).Show();
            //  MemoryStream stream = new MemoryStream(byteArr);
          }
      }
  }
  </code></pre>