If I did this in my MAUI project:
var uploadImage = new UploadImage();
var img = await uploadImage.OpenMediaPickerAsync();
var imagefile = await uploadImage.Upload(img);
var imageBytes = uploadImage.StringToByteBase64(imagefile.byteBase64);
var stream = uploadImage.ByteArrayToStream(imageBytes);
img_profilePic.Source = ImageSource.FromStream(() => stream); //working
I am displaying an image from my ios simulator. At one point in time I have the stream of the IO at my displosal.
If I now add
MemoryStream newStream = new MemoryStream();
stream.CopyTo(newStream);
these two lines of code to my code above, the image I was displaying at that point dissapears. SO somehow, when I copy my stream, I for some reason also delete the already existing stream...?
What is going on here...