I am dynamically creating controls in c# code of my asp.net website. I want to create a image control and display a image which is derived from byte array got from wcf service. I tried to convert the byte array in to image and save in a location with the following code but it does'nt work. Can any one help me!
public System.Drawing.Image byteArrayToImage(byte[] byteArrayIn)
{
MemoryStream ms = new MemoryStream(byteArrayIn);
System.Drawing.Image returnImage = System.Drawing.Image.FromStream(ms);
return returnImage;
}