WebCam Binding?

May 22, 2009 at 10:12 PM

Hi,

I am writing a WPF program to interact with my Logitech webcam and tried to use MediaKit.  I got it into my project but it never shows a picture.  I believe it is because the binding is wrong.  Can anyone help me figure out what CaptureDeviceName should be set as?

<WPFMediaKit_DirectShow_Controls:VideoCaptureElement DesiredPixelHeight="960" DesiredPixelWidth="720" LoadedBehavior="Play" Stretch="Fill" VideoCaptureSource="{Binding Path=CaptureDeviceName}" FPS="30" x:Name="Camera"/>

Thanks,

Kyle

Sep 29, 2009 at 10:03 PM

The VideoCaptureElement can look like this:

 

<DShow:VideoCaptureElement x:Name="videoCapElement"
                 LoadedBehavior="Play"
                 DesiredPixelWidth="320"
                 DesiredPixelHeight="240"
                 Stretch="Fill"
                 VideoCaptureDevice="{Binding Path=SelectedItem, ElementName=videoCapDevices}"
                 FPS="30" EnableSampleGrabbing="True" />

<DShow:VideoCaptureElement x:Name="videoCapElement"

                 LoadedBehavior="Play"

                 DesiredPixelWidth="320"

                 DesiredPixelHeight="240"

                 Stretch="Fill"

                 VideoCaptureDevice="{Binding Path=SelectedItem, ElementName=videoCapDevices}"

                 FPS="30" EnableSampleGrabbing="True" />

 

 

And then the videoCapDevices like this:

          <ComboBox x:Name="videoCapDevices"

          ItemsSource="{Binding Source={x:Static DShow:MultimediaUtil.VideoInputDevices}}"

          DisplayMemberPath="Name"

          Foreground="Black"

          VerticalAlignment="Bottom"

          Margin="8.514,0,0,11.335" HorizontalAlignment="Left" Width="109.819" Height="24"/>