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)建 類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)文章
運(yùn)用.net core中實(shí)例講解RabbitMQ高可用集群構(gòu)建
這篇文章主要介紹了運(yùn)用.net core中實(shí)例講解RabbitMQ高可用集群構(gòu)建,文中相關(guān)示例代碼講解的非常清晰,感興趣的小伙伴可以參考一下這篇文章,相信可以幫助到你2021-09-09
asp.net顯示圖片到指定的Image控件中 具體實(shí)現(xiàn)
這篇文章介紹了asp.net顯示圖片到指定的Image控件中 具體實(shí)現(xiàn),有需要的朋友可以參考一下2013-11-11
使用EF Code First搭建簡(jiǎn)易ASP.NET MVC網(wǎng)站并允許數(shù)據(jù)庫(kù)遷移
這篇文章介紹了使用EF Code First搭建簡(jiǎn)易ASP.NET MVC網(wǎng)站并允許數(shù)據(jù)庫(kù)遷移的方法,文中通過(guò)示例代碼介紹的非常詳細(xì)。對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2022-09-09
.NET Core 遷移躺坑記續(xù)集之Win下莫名其妙的超時(shí)
這篇文章主要介紹了.NET Core 遷移躺坑記續(xù)集之Win下莫名其妙的超時(shí),本文分步驟給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2019-04-04
asp.net 截取Http請(qǐng)求的實(shí)現(xiàn)代碼
本篇文章比較短,主要是因?yàn)槲业囊粋€(gè)隨想產(chǎn)生的一段代碼。 這段代碼的功能你可以叫做是簡(jiǎn)單的Http服務(wù)器也可以叫做Http請(qǐng)求截取。它實(shí)現(xiàn)的功能就是截取Http請(qǐng)求然后自己做處理。2010-06-06
ASP.NET網(wǎng)站的創(chuàng)建與發(fā)布過(guò)程簡(jiǎn)析
這篇文章主要介紹了ASP.NET的創(chuàng)建與發(fā)布過(guò)程,過(guò)程實(shí)現(xiàn)很簡(jiǎn)單,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2015-08-08

