视频截图
有一段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;