2

I am creating an UWP/WinRT app where you can record e.g. a presentation or some operations on your screen, draw on it and so on. I've added a feature where the user can record himself, using his camera device. So you have an additional simple box, with a preview of yourself, that is recorded into the final video. You can resize and move it.

This was working quite nice, but I've got a request that the user should have the possibility to insert multiple camera captures.

On that point I want to say that my standard Camera Capture was written on the basis of the Microsoft sample that is avaiable here

When I tried to add multiple MediaCaptures and CaptureElements everytime the previous ones have stopped previewing.

So I thought I'd create a static CameraCaptureManager that would have a static MediaCapture and CaptureElement, but when I tried add this CaptureElement to multiple UIElements I got the standard error:

Element is already the child of another element.

So I tried to have only a static MediaCapture and create for each box a new CaptureElement with the same source:

var capture = new CaptureElement();
capture.Source = CameraCaptureManager.MediaCapture;
Children.Add(capture);

But it also didn't work. Looks like a MediaCapture can only be the source of one CaptureElement. I've got this error:

The request is invalid in the current state.

Sorry for not pasting much code, but I already have so much I wouldn't know where to start because it'sa quite big project. But the main part, camera capture, is based on the Microsoft sample. I've found samples on GitHub where two (front + back) cameras where used, but I couldn't find any with the same camera is used multiple times on screen. Hope you have samples or have an idea how to do this? Or prove it's impossible (like on Android) :) Thank you

Community
  • 1
  • 1
losik123
  • 580
  • 5
  • 20
  • There is a similar [question](http://stackoverflow.com/questions/43083374/handle-multiple-camera-capture-uwp/43178300#43178300), please refer it. – Jayden Apr 24 '17 at 06:16
  • 1
    I was trying to use the sample you both provided, but it doesn't work if you try to use the same camera (e.g. front) two times.I mean when you want to have the same capture in the left and right viewbox. – losik123 May 05 '17 at 08:20

0 Answers0