Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

[UWP] CaptureElement only displays content after resize

$
0
0

I have a universal Windows app that uses a captureelement to display a camera stream (I set the CaptureElement in a custom renderer vor a View). The thing is, that the stream is only displayed after I manually reset the window (which also resizes the control).

In the renderer I use:

protected override void OnElementChanged(ElementChangedEventArgs<QRScannerControl> e)
{
    captureControl = new CaptureElement();
        this.SetNativeControl(captureControl);
}

to set the element and later in a separate method (on button pressed) I start the stream from a mediacapture element and set the source:

...
mediaCapture = cameraProvider.GetDeviceCameraStream() as MediaCapture;
await mediaCapture.InitializeAsync();
captureControl.Source = mediaCapture;
await mediaCapture.StartPreviewAsync();

What am I missing (I already updated to the latest Xamarin.Forms)?


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>