void capGrabber_NewFrameArrived(object sender, EventArgs e)
{
if (this.Dispatcher!= null)
{
this.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Render, (SendOrPostCallback)delegate
{
if (BitmapSource != null)
{
BitmapSource.Invalidate();
UpdateFramerate();
}
}, null);
}
}