title: Convert Base64 String to Bitmap or Image Xamarin or Android
body: <p>I'm trying to convert a Base64 string to an image and set ImageView using the same image. I know how to get it done in java, but I'm having a trouble in C#. Anyone have an idea of how to get it done in C#? </p>
  
  <p>Some of the code I've tried;</p>
  
  <pre><code>public Image Base64ToImage(string base64String)
   {
      // Convert base 64 string to byte[]
      byte[] imageBytes = Convert.FromBase64String(base64String);
      // Convert byte[] to Image
      using (var ms = new MemoryStream(imageBytes, 0, imageBytes.Length))
      {
          Image image = Image.FromStream(ms, true);
          return image;
      }
   }
  </code></pre>