Hololens/Lib/Cameras.cs
//################################################################################
/// <summary>
/// Display the video in XAML capture element.
/// </summary>
/// <param name="capture_element"> XAML capture element defined in xaml file </param>
Display the video in XAML capture element.
Display the video in XAML capture element .
public async Task DisplayCapture(CaptureElement capture_element)
        {
            if (_capture_enabled)
            {
                await _mediaCapture.StopPreviewAsync();
                _captureElement.Source = null;
                _captureElement = capture_element;
                _captureElement.Source = _mediaCapture;
                await _mediaCapture.StartPreviewAsync(); 
                _capture_displayed = true;
            }
        }
public async Task DisplayCapture ( CaptureElement capture_element ) { if ( _capture_enabled ) { await _mediaCapture . StopPreviewAsync ( ) ; _captureElement . Source = null ; _captureElement = capture_element ; _captureElement . Source = _mediaCapture ; await _mediaCapture . StartPreviewAsync ( ) ; _capture_displayed = true ; } }
Display the video in XAML capture element.
Display the video in XAML capture element .
// capture must be stopped before modify _captureElement // set capture element // restart the capture
capture_element
CaptureElement
XAML capture element defined in xaml file
XAML capture element defined in xaml file