网络摄像头在 xna 中调用 [英] webcam calling in 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屋!