question

ChristianRobertoZaragoza-9276 avatar image
0 Votes"
ChristianRobertoZaragoza-9276 asked LeonLu-MSFT edited

Convertir imagen Xamarin Forms

Hola tengo un código en C# para desrealizar una imagen que obtengo de firebase:

     public static Image Base64StringIntoImage(string str64)
     {
         byte[] img = Convert.FromBase64String(str64);
         MemoryStream ms = new MemoryStream(img);
         return Image.FromStream(ms);
     }

Estoy tratando de hacerlo en c# de xamarin forms pero no me reconoce Image.FromStream(ms);

me podrán ayudar? cual serian la instrucción para xamarin forms equivalente. Desde ya muchas gracias.

dotnet-xamarinformsdotnet-xamarinessentials
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Currently in Microsoft Q&A we only support English, could you please edit your question into English?

0 Votes 0 ·

1 Answer

ChristianRobertoZaragoza-9276 avatar image
0 Votes"
ChristianRobertoZaragoza-9276 answered LeonLu-MSFT edited

encontré la solución, la dejo por si a alguno le sirve

  public static Image Base64StringIntoImage(string str64)
     {
         byte[] img = Convert.FromBase64String(str64);
         MemoryStream ms = new MemoryStream(img);
         return ImageSource.FromStream(() => ms);
     }
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

If you find a solution, I convert it from comment to answer

0 Votes 0 ·