This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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(); |