在WPF中从网络摄像头捕获视频的问题 [英] problem with capturing video from webcam in WPF

查看:432
本文介绍了在WPF中从网络摄像头捕获视频的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我是WPF的初学者。



我刚刚开始捕捉网络摄像头WPF。我最近用C#中的DirectX.Capture.dll做了这个,但现在我正在尝试在WPF中做同样的事情。



这是我的问题:

我也添加了参考资料,我可以启动网络摄像头(它的LED打开,显示它正在工作)但我不知道如何从网络摄像头预览!请帮帮我。



如果我提到我使用以下文章在C#中捕获视频,也许会说得很清楚:DirectX.Capture类库 [ ^ ]





提前致谢。

hi

I'm a beginner in WPF.

I just started capturing webcam in WPF. I recently did that with DirectX.Capture.dll in C#, but now I'm trying to do the same in WPF.

Here is my problem:
I added references as well, and I can start webcam (it's LED turns on which shows that it's working) but I don't know how to get a preview from webcam! Please help me about that.

Maybe it would make it clear if I mention that I used the following article for capturing Video in C#: DirectX.Capture Class Library[^]


Thanks in advance.

推荐答案

我不确定,从您的问题来看,如果您在捕获视频方面遇到问题,或者只是在显示它时。



如果问题是显示,那么有两个类可以帮助你。 MediaElement 示例: - 包含媒体项目列表的简单WPF媒体播放器 [ ^ ]和 MediaPlayer MSDN页面 [ ^ ]。



如果它正在捕获视频,那么你不应该对它是WPF的事实感到困惑。该过程与您在C#中已完成的过程相同。永远记住WPF代表Windows 演示文稿 框架。它是关于呈现内容而不是处理数据。所以WPF应用程序中的大部分工作都将在后面的代码中完成。



希望这会有所帮助。
I am not sure, from your question, if you are having problems in capturing the video, or just in displaying it.

If the problem is the display then there are two classes that may help you. MediaElement example :-A simple WPF media player with media item list[^] and MediaPlayer MSDN page[^].

If it is in capturing the video then you should not be confused by the fact that it is WPF. The process is the same as you have already done in C#. Always remember WPF stand for Windows Presentation Framework. It is about presenting stuff, not processing data. So most of the work in a WPF application will be done in the code behind.

Hope this helps.


这篇关于在WPF中从网络摄像头捕获视频的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆