title: Covert xamarin.image into base 64 format
body: <p>I need to Convert a xamarin forms image into a base64 format, Can anyone help me with this?</p>
  
  <p>This is how i've being trying to do it, but it doesent work.</p>
  
  <pre><code>var inputStream = signatureImage.Source.GetValue(UriImageSource.UriProperty);
  
              //Getting Stream as a Memorystream
              var signatureMemoryStream = inputStream as MemoryStream;
  
              if (signatureMemoryStream == null)
              {
                  signatureMemoryStream = new MemoryStream();
                  inputStream.CopyTo(signatureMemoryStream);
              }
  
              //Adding memorystream into a byte array
              var byteArray = signatureMemoryStream.ToArray();
  
              //Converting byte array into Base64 string
              base64String = Convert.ToBase64String(byteArray);
  </code></pre>
  
  <p>"signatureImage" is the image name.</p>