当前位置: 代码迷 >> ASP.NET >> 乞援,DataGrid 读取表中图片时,图片显示不完整
  详细解决方案

乞援,DataGrid 读取表中图片时,图片显示不完整

热度:10628   发布时间:2013-02-25 00:00:00.0
求助,DataGrid 读取表中图片时,图片显示不完整
DataGrid   绑定表中的图片时(图片以   image格式存储在表中),图片显示不完整,img中

的图片被遮住了一部分,只能看见图片的上部分(这部分感觉就是DataGrid的默认行高)

调整了单元格的高度,img不设宽,高,图片还是显示不完整,还有一点,当DataGrid绑定

图片时,状态栏会显示在读取图片,但就是一直读不出来,非得去追踪执行,图片才能显

示出来,着实没法子,麻烦各位达人出出策,thanks
ds.Tables[0].Rows[i][ "Icon "]   =   " <a   title= ' "   +   FileSize   +   " '   href= '# '   onclick=\ "javascript:popWindows( '../../DLPicture.aspx? "   +   Constant.Query_DownloadRefNum   +   "= "   +   ds.Tables[0].Rows[i][ "DocID "].ToString()   +   " ')\ "> <img   width=80   height=80   border=0   src= '../../DLPicture.aspx? "   +   Constant.Query_DownloadRefNum   +   "= "   +   ds.Tables[0].Rows[i][ "DocID "].ToString()   +   " '/> </a> ";  
-------> 这里是img   读出图片,然后对图片做链接(可以打开图片)
protected   void   GetFileDownload()
{      
        byte[]   outputFile   =   (byte[])   objFUpProp.UploadPicture;
        Response.Clear();
        Response.ClearContent();
        Response.ClearHeaders();
        Response.ContentType   =   objFUpProp.PictureType;//picture   type
        Response.AppendHeader( "content-disposition ", "attachment;   filename= "   +   objFUpProp.PictureName);
  Response.BinaryWrite(outputFile);
                    Response.Flush();
  Response.Close();  
}
这个函数是读出图片文件(DLPicture.aspx)里的函数

------解决方案--------------------------------------------------------
你的图片是以image形式存数据库的吗?
------解决方案--------------------------------------------------------
图片是不是很大?

objFUpProp.UploadPicture; 中读取二进制流数据是否有问题?
  相关解决方案