Save image in Xamarin Forms

Asked

Viewed 1,089 times

2

How to save the image from BD in any existing folder in the project ? I need to create a new folder or save the image to any folder inside the app in order to use it in one View.

My code:

byte[] imageBytes;
var FileImage = new Image();
imageBytes = Convert.FromBase64String(Foto); \\ Foto já está preenchida, é do tipo string
FileImage.Source = ImageSource.FromStream(() => new MemoryStream(imageBytes));
  • Okay, and what’s the difficulty you’re finding? In saving the image, in creating a new directory ?

  • @Jcsaint I don’t know how to do this, I never did. Could you give me a hand ?

  • I could only do it so far @Jcsaint

1 answer

4


  • here says that "Image" does not contain the definition "Fromstream"

  • you have the reference of System.Drawing.Imaging ?

  • No, I’ll add here.

  • I didn’t find it in the nuget no.

  • https://developer.xamarin.com/api/namespace/System.Drawing.Imaging/

  • I haven’t found how to add to the project yet. kkk

  • https://msdn.microsoft.com/en-us/library/7314433t(v=vs.90). aspx

  • beauty, I tried here but gave error "the activex type library was Exported from a . net Assembly and cannot be Added"

  • there’s another way to do it ?

Show 4 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.