private async void OnPostProcessCompleteAsync( byte[] pixelArray, int imageWidth, int imageHeight, ObjectDetails fromObjectDetails, ObjectDetails toObjectDetails) { await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() => { WriteableBitmap bitmap = await ImageProcessingUtils.PixelArrayToWriteableBitmapAsync(pixelArray, imageWidth, imageHeight); if (bitmap != null) { } }); }
private async void OnFrameCapturedAsync(byte[] pixelArray, int frameWidth, int frameHeight, int frameId) { _videoEngine.Messenger.FrameCaptured -= OnFrameCapturedAsync; System.Diagnostics.Debug.WriteLine("OnFrameCapturedAsync"); await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() => { WriteableBitmap bitmap = await ImageProcessingUtils.PixelArrayToWriteableBitmapAsync(pixelArray, frameWidth, frameHeight); if (bitmap != null) { CapturePhoto(bitmap); //capturedPhotoImage.Source = bitmap; //bitmap.Invalidate(); //capturedPhotoImage.Visibility = Visibility.Visible; } _videoEngine.Messenger.FrameCaptured += OnFrameCapturedAsync; }); }