Converting back from Base64 String to Image USING C#.

Posted by vishalneeraj-24503 under ASP.NET category on | Points: 40 | Views : 2575
Write below code:-

public Image Base64ToImage(string base64String)
//First Convert Base64 String to byte[]
byte[] imageBytes = Convert.FromBase64String(base64String);
MemoryStream ms = new MemoryStream(imageBytes,0,imageBytes.Length);

//Then Convert byte[] to Image
Image image = Image.FromStream(ms,true);
return image;

Comments or Responses

Login to post response