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