您的位置:首页 > 编程语言 > ASP

Asp.net获取上传图片大小的尺寸!

2010-05-04 11:07 549 查看
1.采用流取得图片大小 
Stream stream=file.PostedFile.InputStream;
System.Drawing.Image image=System.Drawing.Image.FromStream(stream);

Image.Width
Image.Height

2.使用文件得到图片大小
System.Drawing.Image image=System.Drawing.Image.FromFile(图片路径)
Image.Width
Image.Height
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: