C# Image to base64
I have a base64 image and i have to convert it into Image. I am doing this using this code: public static Image ConvertBase64StringToImage(string imageBase64String) { var imageBytes = Convert.FromBase64String(imageBase64String); var imageStream = new MemoryStream(imageBytes, 0, imageBytes.Length); imageStream.Write(imageBytes, 0, imageBytes.Length); var image = Image.FromStream(imageStream, true); return image; } Then i have to convert this Image into base64 again. Im using this code: public static string ConvertImageToBase64String(Image image) { var imageStream = new MemoryStream(); image.Sav
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.