public System.Drawing.Image byteArrayToImage(byte[] byteArrayIn)
{
System.Drawing.Image returnImage = null;
try
{
MemoryStream ms = new MemoryStream(byteArrayIn);
returnImage = System.Drawing.Image.FromStream(ms); // parameter is invalid
}
catch (Exception ex)
{
string a = ex.ToString();
// Response.Write("sfdsfn");
}
return returnImage;
}
我在网上做了很多搜索,但我无法得到任何有用的答案对我? 提前如何将字节[]转换为asp.net中的图像?
鉴于你的问题是关于ASP.NET,你怎么打算利用你的'Image'?你不能简单地把它放在一个''元素中,如果这就是你的想法,我可以想到的替代用法不需要转换到'System.Drawing.Image'。你最终的目标是什么? –
hvd
你是什么意思的参数是无效的?你能发布你得到的异常吗? –