Articles → CSHARP → Convert Image To Base64 In C#

Convert Image To Base64 In C#






Code


Bitmap bitmap = (Bitmap)Image.FromFile("d:\\capture.jpg");
System.IO.MemoryStream ms = new MemoryStream();
bitmap.Save(ms, ImageFormat.Jpeg);
byte[] byteImage = ms.ToArray();
string SigBase64 = Convert.ToBase64String(byteImage); // Get Base64



Posted By  -  Karan Gupta
 
Posted On  -  Wednesday, August 19, 2020

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250