ASP.NET創(chuàng)建動態(tài)縮略圖的方法
本文實例講述了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
具體代碼如下:
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è)計有所幫助。
- asp.net生成縮略圖示例方法分享
- asp.net中生成縮略圖并添加版權(quán)實例代碼
- asp.net生成縮略圖實現(xiàn)代碼
- asp.net文件上傳功能(單文件,多文件,自定義生成縮略圖,水印)
- asp.net 生成縮略圖代碼
- asp.net 上傳圖片并同時生成縮略圖的代碼
- asp.net 點縮略圖彈出隨圖片大小自動調(diào)整的頁面
- ASP.Net 上傳圖片并生成高清晰縮略圖
- asp.net生成高質(zhì)量縮略圖通用函數(shù)(c#代碼),支持多種生成方式
- ASP.NET中高質(zhì)量縮略圖的生成代碼
- asp.net圖片上傳生成縮略圖的注意事項
- ASP.NET實現(xiàn)根據(jù)URL生成網(wǎng)頁縮略圖的方法
相關(guān)文章
ASP.NET?Core?實現(xiàn)自動刷新JWT?Token
這篇文章主要介紹了ASP.NET?Core?實現(xiàn)自動刷新JWT?Token,通過增加??refresh_token??,客戶端使用refresh_token去主動刷新JWT?Token,下文具體操作過程需要的小伙伴可以參考一下2022-04-04jQuery AJax調(diào)用asp.net webservers的實現(xiàn)代碼
代碼是轉(zhuǎn)載來的 本來今天寫的 但是到現(xiàn)在還沒搞懂,慚愧啊2009-12-12ASP.Net MVC+Data Table實現(xiàn)分頁+排序功能的方法
這篇文章主要介紹了ASP.Net MVC+Data Table實現(xiàn)分頁+排序功能的方法,結(jié)合實例形式分析了asp.net基于mvc架構(gòu)實現(xiàn)的數(shù)據(jù)查詢、排序、分頁顯示等相關(guān)操作技巧,需要的朋友可以參考下2017-06-06Asp.net MVC中Razor常見的問題與解決方法總結(jié)
這篇文章主要給大家介紹了關(guān)于Asp.net MVC中Razor常見的問題與解決方法,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面跟著小編來一起學(xué)習(xí)學(xué)習(xí)吧。2017-08-08.NET Core Windows環(huán)境安裝配置教程
這篇文章主要為大家詳細(xì)介紹了.NET Core Windows環(huán)境安裝配置教程,感興趣的小伙伴們可以參考一下2016-07-07VS2015 免費插件Refactoring Essentials
Refactoring Essentials是一款用于代碼分析和重構(gòu)的開源免費VS2015插件,其功能豐富強(qiáng)大,必然會成為類似Web Essentials這樣的必備插件。2015-07-07