我的软件将连续录制5分钟的视频。 示例:软件应在程序启动时开始录制,并在缓冲区中连续保持5分钟的视频。当我停止录制时,录制的最后5分钟应保存到磁盘
private void CaptureMoni()
{
try
{
Rectangle _screenRectangle = Screen.PrimaryScreen.Bounds;
_screenCaptureJob = new ScreenCaptureJob();
_screenCaptureJob.CaptureRectangle = _screenRectangle;
_screenCaptureJob.ShowFlashingBoundary = true;
_screenCaptureJob.ScreenCaptureVideoProfile.FrameRate = 20;
_screenCaptureJob.CaptureMouseCursor = true;
_screenCaptureJob.OutputScreenCaptureFileName = string.Format(@"C:\test.wmv");
if (File.Exists(_screenCaptureJob.OutputScreenCaptureFileName))
{
File.Delete(_screenCaptureJob.OutputScreenCaptureFileName);
}
_screenCaptureJob.Start();
}
catch(Exception e) { }
}
类似的东西:
private void SaveRecord(int cntMinutes)
{
try
{
_screenCaptureJob.Stop();
// something like that
_screenCaptureJob.SaveLastXMinutes(cntMinutes);
}
catch(Exception e) { }
}