VideoCaptureElement some resolutions are not working/distorted

Jan 28, 2014 at 6:03 PM

Here is what I am getting. This web cam gets this on

I have another 1080p web cam and it's unhappy with those listed above as well as others like 800x600

I am adding the Capture element in code and ten it sets teh resolution based on the selected combo box.

here is the initial setup
 private void SetupVideoPreview()
            m_VcePreview = new VideoCaptureElement();
            m_VcePreview.Stretch = Stretch.Uniform;
            m_VcePreview.HorizontalAlignment = HorizontalAlignment.Left;
            m_VcePreview.VerticalAlignment = VerticalAlignment.Top;
            m_VcePreview.LoadedBehavior = MediaState.Play;
            m_VcePreview.UseYuv = true;
Here is the code that runs when the combo box is changed
 private void cmbResolutions_SelectionChanged(object sender, SelectionChangedEventArgs e)
            if (cmbResolutions.SelectedItem != null)
                VideoFormatDescription vfd = (VideoFormatDescription) cmbResolutions.SelectedItem;

                if (m_VcePreview != null && vfd.device != null)
                    m_FormatDescription = vfd;

                    m_VcePreview.Width = 320;
                    m_VcePreview.Height = 240;
                    m_VcePreview.FPS = vfd.maxFps;
                    m_VcePreview.DesiredPixelWidth = vfd.size.Width;
                    m_VcePreview.DesiredPixelHeight = vfd.size.Height;
                    m_VcePreview.VideoCaptureDevice = null;
                    m_VcePreview.VideoCaptureSource = null;
                    m_VcePreview.VideoCaptureDevice = vfd.device;
                    m_VcePreview.VideoCaptureSource = vfd.device.Name;
Any Ideas on how to solve this?