本文整理汇总了C#中Emgu.CV.Capture.Stop方法的典型用法代码示例。如果您正苦于以下问题:C# Capture.Stop方法的具体用法?C# Capture.Stop怎么用?C# Capture.Stop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Emgu.CV.Capture
的用法示例。
在下文中一共展示了Capture.Stop方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: frameProcessing
private void frameProcessing()
{
_capture = new Capture(_file);
totalFrameCount = _capture.GetCaptureProperty(Emgu.CV.CvEnum.CapProp.FrameCount);
progressBar1.Maximum = (int)totalFrameCount;
timer.Start();
_capture.ImageGrabbed += ProcessFrame;
if (timer.ElapsedMilliseconds == 1000) _capture.Stop();
}
示例2: StartCapture
public async void StartCapture()
{
// Can only access the first camera without CL Eye SDK
if (_camera.TrackerId == 0 && !_camera.Design)
{
_capture = new Capture(_camera.TrackerId);
_ctsCameraCalibration = new CancellationTokenSource();
CancellationToken token = _ctsCameraCalibration.Token;
_capture.Start();
try
{
// needed to avoid bitmapsource access violation?
_captureTask = Task.Run(() =>
{
while (!token.IsCancellationRequested)
{
ImageGrabbed();
}
}, token);
await _captureTask;
}
catch (OperationCanceledException)
{
}
catch (Exception ex)
{
Console.WriteLine(ex.StackTrace);
}
finally
{
_capture.Stop();
_capture.Dispose();
}
}
}