public virtual double CaptureTime { get; } public:virtual property double CaptureTime {double get();}
A value representing the total capture time, in seconds.
This value is reset to zero when you start a new capture.
using Leadtools;using Leadtools.MediaFoundation;using LeadtoolsMediaFoundationExamples.Fixtures;public bool _result = false;public CaptureCtrlForm _form = new CaptureCtrlForm(false);public CaptureCtrl _capturectrl;public double _totalTime;public void ErrorAbortExample(){// reference the capture control_capturectrl = _form.CaptureCtrl;// output filestring outFile = Path.Combine(LEAD_VARS.MediaDir, "CaptureCtrl_ErrorAbortTest.avi");try{// set a test timer to interrupt the capture_form.TestTimer.Interval = 5000;_form.TestTimer.Tick += new EventHandler(TestTimer_Tick);_form.TestTimer.Start();// initialize the total capture time_totalTime = 0;// subscribe to the ErrorAbort event_capturectrl.ErrorAbort += new ErrorAbortEventHandler(CaptureCtrl_ErrorAbort);// subscribe to the event_capturectrl.Progress += new ProgressEventHandler(CaptureCtrl_Progress);// set a video device, use the name of your device hereif (_capturectrl.VideoDevices["USB"] == null)throw new Exception("No USB video device available");_capturectrl.VideoDevices["USB"].Selected = true;// set an audio device, use the name of your device here_capturectrl.AudioDevices["USB"].Selected = true;// set the target output file_capturectrl.TargetFile = outFile;// only 10 seconds of capture time_capturectrl.TimeLimit = 10;_capturectrl.UseTimeLimit = true;// capture it now!_capturectrl.StartCapture(CaptureMode.AutoFramesAndAudio);}catch (Exception){_result = false;}// we'll loop on the state and pump messages for this example.// but you should not need to if running from a Windows Forms application.while (_capturectrl.State == CaptureState.Running)Application.DoEvents();}public void TestTimer_Tick(object sender, EventArgs e){// stop the capture_capturectrl.StopCapture();}public void CaptureCtrl_Progress(object sender, ProgressEventArgs e){_totalTime = _capturectrl.CaptureTime;}public void CaptureCtrl_ErrorAbort(object sender, ErrorAbortEventArgs e){// set result_result = true;}static class LEAD_VARS{public const string MediaDir = @"C:\LEADTOOLS23\Media";}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
