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

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

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

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

提示:

1. 導入 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

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

相關(guān)文章

最新評論

彰武县| 古交市| 柏乡县| 莱州市| 泌阳县| 新巴尔虎右旗| 双辽市| 襄垣县| 南开区| 金昌市| 临洮县| 贵溪市| 高尔夫| 黄骅市| 玉山县| 桑植县| 温州市| 岢岚县| 小金县| 焉耆| 太仓市| 拜城县| 抚顺县| 杭州市| 禹城市| 裕民县| 格尔木市| 临清市| 靖安县| 阳江市| 砚山县| 宣武区| 青河县| 普格县| 合山市| 会泽县| 荔浦县| 正阳县| 潜山县| 承德市| 永靖县|