mmaitre314 / MediaCaptureWPF

Camera preview in WPF Desktop apps using WinRT MediaCapture
http://mmaitre314.github.io/MediaCaptureWPF
Apache License 2.0
52 stars 26 forks source link

Build status NuGet package Symbols

CameraPreview allows previewing the camera video stream of the WinRT MediaCapture API in Desktop WPF apps.

Preview

CameraPreview derives from D3DImage and can be used anywhere a GPU-accelerated ImageSource can be. For instance, inside an <Image> XAML element:

<Grid>
    <Image Name="Preview"/>
</Grid>

The C# code behind creates MediaCapture, initializes it, and passes it to CameraPreview. This object is then set as source of the <Image> element and preview is started.

var capture = new MediaCapture();
await capture.InitializeAsync();

var preview = new CapturePreview(capture);
Preview.Source = preview;
await preview.StartAsync();

References