学习型 ASP/PHP/ASP.NET 主机 30元/年全能 ASP/PHP/ASP.NET 主机,支持月付专业 MSSQL 数据库空间,支持月付专业 MySQL 数据库空间,支持月付
发新话题
打印

有谁能给出个比较简单的生成图片缩略图的方法??

有谁能给出个比较简单的生成图片缩略图的方法??

注意:这些图片不是存在数据库里的哦!!!是直接上传存在文件夹里的!

看了很多例子,但是都很繁很难懂!!!!

TOP

asp.net可以吗?
http://www.68bar.com 版主位置空缺

TOP

当我们要上传图片的时候,往往需要生成缩略图,以往我们要使用第三方控件才能完成。在asp.net中用下面方法轻松搞定:

  <script language="VB" runat="server">   Sub Page_Load(sender As Object, e As EventArgs)

  Dim image,aNewImage As System.Drawing.Image   dim width,height,newwidth,newheight as integer   Dim callb As System.Drawing.Image.GetThumbnailImageAbort

  '生成缩略图   image=System.Drawing.Image.FromFile(Server.MapPath("classpic/"+"rs1.jpg"))   width=image.Width   height=image.height   if width>height then   newwidth=110   newheight=image.height/image.Width*newwidth   else   newheight=110   newwidth=image.Width/image.height*newheight   end if

  aNewImage=image.GetThumbnailImage(newwidth,newheight,callb,new System.IntPtr())   aNewImage.Save(Server.MapPath("smallpic/"+"rs1.gif"))   image.Dispose()

  End Sub   </script>


http://www.68bar.com 版主位置空缺

TOP

ASP中啊!!!你怎么用VB呢/??
我是假的!我没脑筋,没有心肠,没有胆子,没有骨气,没剑,没钱,是个真真的大洞口.我身上空得连一块肉都没有... http://www.jqjsw.com 剧情介绍网......

TOP

她写的是asp.net的,说以 language="VB"

asp的话只好用组件来实现了,aspjpeg不错吧!

四月天原创文学网 http://yc.4yt.net

TOP

发新话题