We are required to Display Live View from a Camera in a WPF Application.
A TV-Tuner is being used to capture the video.
We had already achieved this in WinForm (VS2005) using DShow.
To implement this in WPF we are using the same code (code used in WinForm) except that we pass the Handle to DShow's "SetVideoClippingWindow(IntPtr hwnd)" by using "new WindowInteropHelper(this).Handle" as shown below:

IntPtr mainWindowHandle;
        private void mainWindow_Loaded(object sender, RoutedEventArgs e)
            mainWindowHandle = new WindowInteropHelper(this).Handle;

        private void LiveView()
            //code copied from WinForm application which was working fine.
            hr = windowlessCtrl.SetVideoClippingWindow(mainWindowHandle);

But we get a White Blank Screen (have made the default grid present on top of the Window small to enable us to see the Window on which we expect the Live View to be displayed.)

Please guide if there is anything else to be done to get the LiveView in WPF.

I had missed SetVideoPosition(....).
Now I am getting the Live View.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.