Skip to content

Latest commit

 

History

History
37 lines (27 loc) · 2.08 KB

README.md

File metadata and controls

37 lines (27 loc) · 2.08 KB

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