title: Xamarin Forms - Resize Camera Picture
body: <p>Someone helped me get this code for taking a picture using xamarin forms labs camera:</p>
  
  <pre><code>picker = DependencyService.Get&lt;IMediaPicker&gt; ();  
                  task = picker.TakePhotoAsync (new CameraMediaStorageOptions {
                      DefaultCamera = CameraDevice.Rear, 
                      MaxPixelDimension = 800,
  
                  });
  
                  img.BackgroundColor = Color.Gray;
  
                  Device.StartTimer (TimeSpan.FromMilliseconds (250), () =&gt; {
                      if (task != null) {
                          if (task.Status == TaskStatus.RanToCompletion) {
                              Device.BeginInvokeOnMainThread (async () =&gt; {
                                  //img.Source = ImageSource.FromStream (() =&gt; task.Result.Source);
                                  var fileAccess = Resolver.Resolve&lt;IFileAccess&gt; ();
                                  string imageName = "img_user_" + User.CurrentUser().id + "_" + DateTime.Now.ToString ("yy_MM_dd_HH_mm_ss") + ".jpg";
                                  fileName = imageName;
  
                                  fileAccess.WriteStream (imageName, task.Result.Source);
                                  fileLocation = fileAccess.FullPath(imageName);
  
                                  FileStream fileStream = new FileStream(fileAccess.FullPath(imageName), FileMode.Open, System.IO.FileAccess.Read);
                                  imageUrl = (string)test[0]["url"];
                                  img.Source = imageUrl;
                              }); 
                          }
  
                              return  task.Status != TaskStatus.Canceled
                              &amp;&amp; task.Status != TaskStatus.Faulted
                              &amp;&amp; task.Status != TaskStatus.RanToCompletion;
                      }
                      return true;
                  });
  </code></pre>
  
  <p>It saves the image, but the actual size of the phone picture taken is huge, is there a way to resize it.</p>