Skip to content

jb455/MediaCaptureWPF

 
 

Repository files navigation

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

About

Camera preview in WPF Desktop apps using WinRT MediaCapture

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 72.8%
  • C# 12.7%
  • PowerShell 9.8%
  • Batchfile 2.6%
  • C 2.1%