How to use the control from a C ++ / CLI project for use in my WPF application?

I found an example of a control written in C ++ / CLI that captures and displays a webcam channel using DirectShow. I would like to take this example and use it from my WPF application. I tried (and was confused) with several different approaches, including choosing the Webcam class and creating a HwndHostWPF from my application to load the webcam control. I lied to all these things, but my understanding of what I'm trying to achieve is not enough to formulate a sufficiently specific question.

So, I am looking for some recommendations regarding the general approach that I must take to achieve this. What do I need to do to open the C ++ webcam component for use by my WPF application? And then, what approach should be taken to use this C ++ component - Wrapper? PInvoke? Something else?

+3
source share
1 answer

If you need a webcam in WPF, you can try my WPF MediaKit . It has a VideoCaptureElement element that you can use, and you will not have problems with airspace.

- .NET, Winforms. , WindowsFormsHost. vs raw HwndHost.

+2

Source: https://habr.com/ru/post/1767262/


All Articles