Skip to content

Instantly share code, notes, and snippets.

View arctouch-williamrodriguez's full-sized avatar
🏠
Working from home 🤓

William S. Rodriguez arctouch-williamrodriguez

🏠
Working from home 🤓
View GitHub Profile
//How to use
var imageAsByteArray = GetImageFromFile("Folder.Imagename.jpg");
var imageToBase64String = Convert.ToBase64String(imageAsByteArray, 0, imageAsByteArray.Length);
//Loading into a Xamarin Forms Image Source
theImage.Source = ImageSource.FromStream(() => new MemoryStream(imageAsByteArray));
private byte[] GetImageFromFile(string fileName)
{
var applicationTypeInfo = Application.Current.GetType().GetTypeInfo();