VideoCaptureElement some resolutions are not working/distorted

Jan 28, 2014 at 5:03 PM
https://dl.dropboxusercontent.com/u/5315821/Broken.jpg

Here is what I am getting. This web cam gets this on
352x288
176x144
160x120

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.BeginInit();
            m_VcePreview.Stretch = Stretch.Uniform;
            m_VcePreview.HorizontalAlignment = HorizontalAlignment.Left;
            m_VcePreview.VerticalAlignment = VerticalAlignment.Top;
            m_VcePreview.LoadedBehavior = MediaState.Play;
            m_VcePreview.UseYuv = true;
            m_VcePreview.EndInit();
            canvasPreviewWrapper.Children.Add(m_VcePreview);
        }
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?