首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

视频截图,该如何处理

2012-02-03 
视频截图有一段mkv视频,想取的视频的时间长度,然后根据不同时间的 ,截取几张图,例如 ,每隔10分钟,从视频截

视频截图
有一段mkv视频,想取的视频的时间长度,然后根据不同时间的 ,截取几张图,
例如 ,每隔10分钟,从视频截取一张。
请教 例子或者源码

[解决办法]
簡單截圖:

Delphi(Pascal) code
function PrintWindow(SourceWindow: hwnd; Destination: hdc; nFlags: cardinal): bool; stdcall; external 'user32.dll' name 'PrintWindow'; function PrintWindow(SourceWindow: hwnd; Destination: hdc; nFlags: cardinal): bool; stdcall; external 'user32.dll' name 'PrintWindow';<br/>procedure TForm1.Button2Click(Sender: TObject); var   bmp : TBitmap;   wnd : cardinal;   rec : TRect; begin   wnd := FindWindow(nil, '计算器'); // 查找窗口句柄,这里用计算器演示   GetWindowRect(wnd, rec); //获取到计算器窗口的举行   bmp := TBitmap.Create;   try     bmp.Width := rec.Right - rec.Left;     bmp.Height := rec.Bottom - rec.Top;     bmp.PixelFormat := pf24bit;     PrintWindow(wnd, bmp.Canvas.Handle, 0);     bmp.SaveToFile('cao.bmp');   finally     bmp.Free;   end; end; 

热点排行