C# control to display camera video with DirectShow.Net
I want to use DirectShow.Net to capture the stream from a webcam.
What type of UI control can I use to display a the webcam video capture?
I have seen an example that uses the whole window of a Form, but are there any开发者_Python百科 other controls I can use: a Panel, PictureBox?
yes. you can use pictureboxes or forms or panels.
You need to call and use IVideoWindow. you can cast the directshow.net graph that is streaming/capturing to the IVideoWindow and then you can set it to being owned by whatever object you want to put your video stream into. just have to give it the objects handle and then set its windowstyle to child of the parent object.
IVideoWindow videowindow;
videowindow = FirstGraph as IVideoWindow;
videowindow.put_Owner(panel1.Handle);
videowindow.put_WindowStyle(WindowStyle.Child | WindowStyle.ClipChildren);
http://channel9.msdn.com/Forums/TechOff/93476-Programatically-Using-A-Webcam-In-C - its not formatted, but it has a code that actually implants what you need.
精彩评论