Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

CrossMedia and Getting Images

$
0
0

I'm working on an app that is basically an inventory management piece. Snap some photos, upload them to a server. One of the requirements is that those images are saved until the user is on WiFi to upload (for obvious reasons).

I have the app working converting the images to byte arrays and storing them in the database, but obviously you use quite a bit of quality with that. So, here's what I'm developing:

User takes the photos, photos are stored in the App directory (working). What I need help with is how to get those photos back out, either in a cross-platform way with the PCL or with a Dependency.

I noticed that you can create a new MediaFile in CrossMedia:
var file = new MediaFile(photo.FilePath, () => new MemoryStream());
This compiles, but then breaks with a null exception. I'm imagining it's from the MemoryStream part, because I couldn't find any documentation for the parameter "Func streamGetter".

I need the images in two places - to show them on a Review screen, and to send them via an API request for the upload.

Has anyone done anything like this? I know people have, but I'm trying to find the best solution for fetching the photos from the app directory in a efficient way. My googling has come up empty (maybe just the wrong terms), but any help anyone could give would be greatly appreciated!

Thanks!


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>