Answers for "converting image to base64 C#"

C#
-3

converting image to base64 C#

using (Image image = Image.FromFile(Path))
{
    using (MemoryStream m = new MemoryStream())
    {
        image.Save(m, image.RawFormat);
        byte[] imageBytes = m.ToArray();

        // Convert byte[] to Base64 String
        string base64String = Convert.ToBase64String(imageBytes);
        return base64String;
    }
}
Posted by: Guest on November-05-2020
-2

c# convert base 64 string to image

base 64
Posted by: Guest on September-15-2021

C# Answers by Framework

Browse Popular Code Answers by Language