byte[] b = Convert.FromBase64String(theAnnotation.Rows[z]["DocumentBody"].ToString()); MemoryStream stream = new MemoryStream(b, 0, b.Length); Bitmap tempimg = new Bitmap(stream); 我想将数据流转换成图片显示到网页上面。最好能放到控件上, 能不能用GridView 控件将查询结果显示出来,数据流自动转换成图片
yte[]im=(byte[])commond.executescalar();memorystreamstream=newmemorystream(im,false);picturebox1.image=image.fromstream(stream);//报错,参数无效????stream.close();con.close();sqlcommandcommond=newsqlcommand("selectpersonimagefromtemp",con);这里需要修改一下,你要判断你要找的是哪个图片?修改为using(memorystreamms=newmemorystrem(im)){ picturebox1.image=image.fromstream(stream);}