I need convert image to Data URL (embedding Image) in the Win-application for HTML and I need Data URL (embedding Image) to image.
public static string GetDataURL(string imgFile) { return "<img src="data:image/" + Path.GetExtension(imgFile).Replace(".","") + ";base64," + Convert.ToBase64String(File.ReadAllBytes(imgFile)) + "" />"; }
2.1m questions
2.1m answers
60 comments
57.0k users