I am using Visual studio 2012, C #, silverlight, a Windows Phone 8 app.
We get our data from the web service, and through the web service we get the image, which is the base.
I am converting it to an array of bytes, and now I want to save it so that the storage of a Windows phone using a memory stream? I don’t know if it fits right. I don’t want to save it in isolated storage, just in a local folder, because I want to show a picture after a person clicks on a link.
this is what i have so far.
byte[] ImageArray; var image = Attachmentlist.Attachment.ToString(); imagename = Attachmentlist.FileName.ToString(); ImageArray = Convert.FromBase64String(image.ToString()); StorageFolder myfolder = Windows.Storage.ApplicationData.Current.LocalFolder; await myfolder.CreateFileAsync(imagename.ToString()); StorageFile myfile = await myfolder.GetFileAsync(imagename.ToString()); MemoryStream ms = new MemoryStream();
after I initialized the memory stream, how can I take an array of bytes and write it to the storage file, and then return it again?
source share