如何获取从数据库中读取出的图片尺寸 数据库:SQL Server 2005语言:C#数据类型:image如何获取图片的width & height?? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 只要你能把图片数据读出来还原成图片用Image属性就知道Height,Width了 1. if (Convert.IsDBNull(o)) { hasPhoto = false; } else { ks_photo = (byte[])dt.Tables[0].Rows[0]["ks_photo"]; if (ks_photo.Length == 0) hasPhoto = false; else hasPhoto = true; } 2. public static Image Photo { get { if (hasPhoto == false) return null; System.IO.MemoryStream ms = new System.IO.MemoryStream(ks_photo); Image im = Image.FromStream(ms); ms.Close(); return im; } }3.Photo.Width,Photo.Height C#采集网页 sapn windows服务访问网络共享文件夹 谁有办法复制一个受限制的文件夹 我想从一个目录下,把一个文件夹复制到另一个目录下,怎么办呢? 怎样屏蔽键盘的单撇号,禁止在一个TextBox中输入单撇号! 如何让子窗体调用主窗体的数据库连接? C#事件和委托是怎末回事???!!!!! C/S,gridview如何判断单元格数据源相同 winform (C#)Mdi窗口切换闪烁问题 如何在后台动态生成表格并且填入数据,并且放入checkbox SQL 如何循环Select出来的结果! 2005 下读取文件路径的问题
{
hasPhoto = false;
}
else
{
ks_photo = (byte[])dt.Tables[0].Rows[0]["ks_photo"];
if (ks_photo.Length == 0)
hasPhoto = false;
else
hasPhoto = true;
}
2. public static Image Photo
{
get
{
if (hasPhoto == false)
return null;
System.IO.MemoryStream ms = new System.IO.MemoryStream(ks_photo);
Image im = Image.FromStream(ms);
ms.Close();
return im;
}
}
3.Photo.Width,Photo.Height