net後臺對視頻進行截圖

 

http://www.codeproject.com/Articles/9676/Extracting-still-pictures-from-movie-files-with-C//英文的,有例子下載

能載圖的視頻格式*.avi, *.mpeg, *.mov (QuickTime), and *.dat (DivX).。其他不行。

using System

;using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

using Microsoft.DirectX.AudioVideoPlayback;//安裝DirectX

using System.Drawing.Imaging;

using System.Runtime.InteropServices;

using DexterLib;//這個在系統中有Interop.DexterLib.dll

using System.Threading;

 

 

方法

 

    MediaDetClass md = new MediaDetClass();//生成MediaDetClass。在DexterLib.dll

    md.Filename = "D:\\ ..\\Video\\gg.avi";//要截取視頻的路徑,網頁後臺路徑也是絕對路徑
 md.CurrentStream = 0;
 string fBitmapName = "D:\\..\\Video\\sample" + ".bmp";//圖片生成路徑
 md.WriteBitmapBits(3, 320, 240, fBitmapName);//http://msdn.microsoft.com/zh-cn/library/ms785896(v=VS.85).aspx 方法說明,參數一是視頻時間點,

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章