C#控件来显示摄像头视频DirectShow.Net [英] C# control to display camera video with DirectShow.Net
问题描述
我想用DirectShow.Net捕捉来自一个摄像头流。
我可以使用哪些类型的UI控件来显示一个网络摄像头视频捕捉<? / p>
我已经看到了使用窗体的整个窗口的例子,但是否有任何其他控件我可以使用:一个面板,图片框
是的。您可以使用pictureboxes或表格或面板。
您需要调用和使用IVideoWindow。你可以投的是流/捕获到IVideoWindow的directshow.net图,然后您可以将其设置为你想要把你的视频流为任何对象所拥有。 。只要给它的对象句柄,然后设置其windowstyle父对象的子
IVideoWindow视频窗口;
视频窗口= FirstGraph为IVideoWindow;
videowindow.put_Owner(panel1.Handle);
videowindow.put_WindowStyle(WindowStyle.Child | WindowStyle.ClipChildren);
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 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);
这篇关于C#控件来显示摄像头视频DirectShow.Net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!