网络摄像头在 xna 中调用 [英] webcam calling in xna

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

问题描述

我是 xna 的新手

我想使用我的网络摄像头并将网络摄像头图像制作为 3D 模型的背景纹理

是否有调用网络摄像头的函数

感谢您的建议

解决方案

如果您查看 AForge 框架,您将找到一个示例程序,该程序对网络摄像头源进行运动检测.

http://code.google.com/p/aforge/>

这个框架有一个非常容易获取网络摄像头的提要.

基本结束

VideoCaptureDevice device = new VideoCaptureDevice(monikor);device.NewFrame += new AForge.Video.NewFrameEventHandler(webcam_NewFrame);网络摄像头.开始();

您可以通过调用类似于...的代码获取网络摄像头的名字.

FilterInfoCollection webcamList = new FilterInfoCollection(FilterCategory.VideoInputDevice);foreach(网络摄像头列表中的过滤器信息信息){字符串monikor = info.MonikorString;字符串 deviceName = info.Name;}

这是我遇到的获取网络摄像头提要的最佳/最简单的方法.

然后就可以将Bitmap转成Texture2D,随心所欲地显示了!

i am new in xna

i want to use my webcam and make webcam image as a background texture for 3D models

is there a function that calls webcam

thanks for suggestions

解决方案

If you check out the AForge framework you'll find a sample program that does motion detection on webcam feeds.

http://code.google.com/p/aforge/

This framework has a very easy to get webcam feeds.

Basically ends up

VideoCaptureDevice device = new VideoCaptureDevice(monikor);
device.NewFrame += new AForge.Video.NewFrameEventHandler(webcam_NewFrame);
webcam.Start();

where you can get the webcam's monikor by calling code similar to...

FilterInfoCollection webcamList = new FilterInfoCollection(FilterCategory.VideoInputDevice);

foreach(FilterInfo info in webcamList)
{
    string monikor = info.MonikorString;
    string deviceName = info.Name;
}

This is the best/easiest way i've come across to get webcam feeds.

Then you can convert the Bitmap into a Texture2D and display as you wish!

这篇关于网络摄像头在 xna 中调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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