Articles → .NET → 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