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