主頁(yè) > 知識(shí)庫(kù) > ASP.NET創(chuàng)建動(dòng)態(tài)縮略圖的方法

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

熱門(mén)標(biāo)簽:阿里云 硅谷的囚徒呼叫中心 百度競(jìng)價(jià)排名 服務(wù)器配置 集中運(yùn)營(yíng)管理辦法 網(wǎng)站排名優(yōu)化 地方門(mén)戶(hù)網(wǎng)站 科大訊飛語(yǔ)音識(shí)別系統(tǒng)

本文實(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è)縮略圖的方法

標(biāo)簽:廣西 西雙版納 威海 甘孜 開(kāi)封 隨州 梧州 烏蘭察布

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《ASP.NET創(chuàng)建動(dòng)態(tài)縮略圖的方法》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢(xún)

    • 400-1100-266