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)里的函数
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形式存数据库的吗?
回hello_okay 写的时候是以 byte格式
数据库端该字段为 image
image大小长度只有16位,但我图片大小只有几十K左右,照理说可以放得下那个读取图片的页面 DLPicture.aspx 之前是用来读取文件的上传文件也是以这种模式image保存在数据库,然后以byte读出
非得去追踪执行 ??????是的,不然状态栏一直显示在读取图片thanks
群1:29156948 满
群2:44572142 满
群3:22166975
群4:40338953
群5号40339019 满
群6:12431253 满只有 3 4还有位置。。请大家加 3号 4号群。。
新手请上论坛学习 http://net.yybmw.cn学习文档 上论坛FTP站点下载这里是学习 交流的地方。请不要灌水或发广告。。违者 立封ID
aryCommand.Add(new System.Data.SqlClient.SqlParameter("@UploadPicture",System.Data.SqlDbType.VarBinary,2147483647,"UploadPicture"))这里 2147483647 之前给定太小了 最大可以指定多少?
gv_donation.Rows[i].Cells[1].Text=“”;“”里面加载图片,用html来控制他的宽和高,我那个是gridview的,你可以改成datagrid。
群1:29156948 满
群2:44572142 满
群3:22166975
群4:40338953
群5号40339019 满
群6:12431253 满只有 3 4还有位置。。请大家加 3号 4号群。。
新手请上论坛学习 http://net.yybmw.cn学习文档 上论坛FTP站点下载这里是学习 交流的地方。请不要灌水或发广告。。违者 立封ID