最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

ASP.NET創(chuàng)建動(dòng)態(tài)縮略圖的方法

 更新時(shí)間:2015年06月16日 10:20:36   作者:小卒過(guò)河  
這篇文章主要介紹了ASP.NET創(chuàng)建動(dòng)態(tài)縮略圖的方法,實(shí)例分析了asp.net動(dòng)態(tài)操作圖片的相關(guān)技巧,需要的朋友可以參考下

本文實(shí)例講述了ASP.NET創(chuàng)建動(dòng)態(tài)縮略圖的方法。分享給大家供大家參考。具體分析如下:

提示:

1. 導(dǎo)入 System.IO
2. 創(chuàng)建 類C lass "CreateThumbnails"
or any class and place following function inside that class

You need one function to response call back to main function

Function ImageAbortDummyCallback() As Boolean
Return False
End Function

具體代碼如下:

Function CreateJPEGThumbnail(ByVal inSourceFile As String, ByVal inDestinationFile As String, ByVal ThumbWidth As Integer, ByVal ThumbHeight As Integer) As Boolean
  Dim imageFile As System.Drawing.Image
  Dim outputFstream As New FileStream(inSourceFile, FileMode.Open, FileAccess.Read) 
  'Exposes a System.IO.Stream around a file, supporting both synchronous and asynchronous read and write operations.
  Dim ImageAbortCallBack As System.Drawing.Image.GetThumbnailImageAbort 
  'This method returns true if it decides that the System.Drawing.Image.GetThumbnailImage method should prematurely stop execution; otherwise, it returns false.
  imageFile = System.Drawing.Image.FromStream(outputFstream)
  ImageAbortCallBack = New System.Drawing.Image.GetThumbnailImageAbort(AddressOf ImageAbortDummyCallback)
  imageFile = imageFile.GetThumbnailImage(ThumbWidth, ThumbHeight, ImageAbortCallBack, IntPtr.Zero) 
  'IntPtr = A platform-specific type that is used to represent a pointer or a handle.
  imageFile.Save(inDestinationFile, System.Drawing.Imaging.ImageFormat.Jpeg)
  outputFstream.Close()
  outputFstream = Nothing
  imageFile = Nothing
End Function

希望本文所述對(duì)大家的asp.net程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論

称多县| 长治县| 高阳县| 萨迦县| 沧源| 石家庄市| 南澳县| 文昌市| 乳山市| 太和县| 新绛县| 敦煌市| 新兴县| 盖州市| 年辖:市辖区| 通榆县| 红原县| 高邮市| 囊谦县| 丰县| 辉县市| 玉林市| 壤塘县| 新疆| 灵丘县| 敦化市| 衡阳县| 思茅市| 富平县| 黔南| 正宁县| 加查县| 盐边县| 陆良县| 日照市| 枝江市| 南靖县| 南涧| 六枝特区| 盈江县| 诸城市|