佳木斯湛栽影视文化发展公司

主頁 > 知識庫 > ASP.NET創(chuàng)建動態(tài)縮略圖的方法

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

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

本文實例講述了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)頁縮略圖的方法

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

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

    • 400-1100-266
    安龙县| 平南县| 桑日县| 秦皇岛市| 郎溪县| 南岸区| 临泉县| 和林格尔县| 钟山县| 正定县| 常德市| 旅游| 明水县| 綦江县| 邵阳县| 个旧市| 鄂托克旗| 稻城县| 泽普县| 定州市| 静海县| 星座| 阿合奇县| 天津市| 蓬莱市| 霸州市| 彭阳县| 平武县| 苏尼特右旗| 新丰县| 南京市| 海原县| 永定县| 徐汇区| 芒康县| 林口县| 龙里县| 荔波县| 冷水江市| 华阴市| 乌苏市|