我需要用实时摄像机每秒捕捉 10 帧,持续 15 分钟。我使用了 dispatcherTimer 类,但它似乎不能正常工作。如何做到准确?我什至不保存图像,因为它很耗时,我只是将它保存在内存中,但它仍然无法正常工作。 我应该使用另一个图书馆吗?
counter01 = new DispatcherTimer();
counter01.Tick += new EventHandler(counter01_Tick);
counter01.Interval = new TimeSpan(0, 0, 0,100); // every 100 milliseconds == 10 frames per seconds
请您参考如下方法:
Timers are not guaranteed to execute exactly when the time interval occurs, but they are guaranteed to not execute before the time interval occurs.
可以查看StopWatch ,它可能对你有帮助。
