For a PCL application I'm developing I'm using the media plugin for Xamarin Forms by jamesmontemagno (Github Repo). I am mainly using the plugin for capturing photos through the device's camera, for this I'm using the TakeVideoAsync method (
Task<MediaFile> TakeVideoAsync(StoreVideoOptions options);). It returns a
The issue I'm facing is that I need to send the image as an email attachment. For this I will implement an "EmailSender" class which will have different implementations for every target platforms (I'm using the PCL approach). Right now I'm working on a Windows Phone 8.1 (Silverlight) implementation. I would like to use
Windows.ApplicationModel.Email.EmailManager to send a
Windows.ApplicationModel.Email.EmailMessage. An example implementation can be seen in this Stackoverflow answer (Look at the "ComposeEmail" method).
What I need help with:
I want to find a way of retrieving the image file (perhaps either as an StorageFile or RandomAccessStream) in order to make an EmailAttachment object from it. From the
MediaFile returned by the
TakeVideoAsync method in the media plugin I can get a
System.IO.Stream, but I haven't found any way of converting it to a
RandomAccessStream with the functionality of the .NET version my Xamarin Windows Phone 8.1
All suggestions will be very appreciated.