private async Task GetVideoCaptureFrames(CancellationToken token) { while (!token.IsCancellationRequested) { var bitmap = VideoCapture.GetBitmap(); if (bitmap != null) { VideoCaptureBitmap = bitmap; UserImagePictureBox.Image = FaceRecognitionClient.GetBitmapWithLocations(VideoCaptureBitmap); } await Task.Delay(10, token); } }