国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > .NET > 正文

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

2024-07-10 13:29:09
字體:
供稿:網(wǎng)友

這篇文章主要介紹了ASP.NET創(chuàng)建動態(tài)縮略圖的方法,實(shí)例分析了asp.net動態(tài)操作圖片的相關(guān)技巧,需要的朋友可以參考下

本文實(shí)例講述了ASP.NET創(chuà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

具體代碼如下:

 

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

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

發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 盐山县| 商都县| 奉化市| 凤山市| 望奎县| 隆昌县| 沁阳市| 大邑县| 达日县| 杨浦区| 西吉县| 巫溪县| 松溪县| 滦南县| 巴塘县| 连南| 互助| 德钦县| 伊宁县| 娱乐| 武胜县| 廉江市| 邵武市| 寿阳县| 太白县| 金华市| 高要市| 景洪市| 友谊县| 蓬安县| 合川市| 聂拉木县| 永济市| 疏勒县| 都匀市| 剑川县| 旅游| 瓦房店市| 乌兰察布市| 都昌县| 格尔木市|