So I wanted to use the UWP MediaCapture in my WPF application as shown in this example. The only difference is, that I need a BitmapImage from WPF as output instead of a file or UI.XAML BitmapImage.
I've already tried multiple things which didnt quite bring me to what I need, such as the following which converts the InMemoryRandomAccessStream into a UI.XAML BitmapImage from UWP.
using var stream = new InMemoryRandomAccessStream();
await _mediaCapture.CapturePhotoToStreamAsync(ImageEncodingProperties.CreateJpeg(), stream);
stream.Seek(0);
var source = new BitmapImage();
await source.SetSourceAsync(stream);
As an alternative converting the UI.XAML BitmapImage into a Windows.Media BitmapImage would also work.