您的位置:首页 > 其它

.NET生成缩略图

2004-08-09 23:15 253 查看
MemoryStream stream1 = new MemoryStream((byte[])detail.Image);//取图片数据流,你自己读文件先.
System.Drawing.Image tempimg = System.Drawing.Image.FromStream(stream1);//转成图片类
System.Drawing.Image myThumbnail = tempimg.GetThumbnailImage(width,height,null, IntPtr.Zero);//缩略,width,height你自己要定义好大小
myThumbnail.Save(Response.OutputStream,tempimg.RawFormat);//显示
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: