通过 XNA 应用程序在 Windows Phone 7 中进行相机捕获
我知道微软到目前为止还没有正式支持任何视频捕获应用程序。我找到了 Clarity Consulting 博客条目,其中重点介绍了如何通过 Silverlight 使用相机(条目位于:http://blogs.claritycon.com/kevinmarshall/2010/12/23/wp7-camera-access-flashlight-augmented-reality -和条形码扫描/)。但是,到目前为止,我尚未成功移植 XNA 框架使用的代码。
有人在 XNA 应用程序中使用过 Windows Phone 7 摄像头吗?如果是这样,愿意分享您的智慧吗?
谢谢!
I know that Microsoft hasn't officially supported doing any video capture applications as of yet. I've found the Clarity Consulting blog entry that highlights how to use the camera through Silverlight (entry is here: http://blogs.claritycon.com/kevinmarshall/2010/12/23/wp7-camera-access-flashlight-augmented-reality-and-barcode-scanning/). But, as of yet, I have been unsuccessful in porting the code to be used by an XNA framework.
Has anyone had any luck either using the Windows Phone 7 camera in an XNA application? If so, care to share your wisdom?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
一般来说,您可以像在 Silverlight 中一样访问相机 - 有
CameraCaptureTask
- 您需要首先添加对Microsoft.Phone
的引用,然后从游戏。这将用于静态捕获,您的事件处理程序如下所示:
目前,视频录制是通过 未记录的方式 - 这很可能会让您的应用提交被市场拒绝,但仍有可能。
这样做的目的是,随着录制的进行,IsolatedStorage 中的 MP4 文件会不断更新。但话又说回来,有一些方法可以将该文件包含在媒体库中。
Generally you can access the camera the same way you do it in Silverlight - there is the
CameraCaptureTask
- you need to add a reference toMicrosoft.Phone
first and then call it from the game.That would be for static capture, and your event handler is like this:
Currently, video recording is done through the undocumented way - this will most likely get your app submission disapproved from the Marketplace, but it is possible nonetheless.
What's done that way is a MP4 file is constantly updated in the IsolatedStorage as the recording is in progress. But then again, there are methods present to include the file in the media library.
认为您对整个微软和支持相机有点不清楚。
微软不久前发布了Expression Encoder 4,它不仅可以让您视频屏幕捕获您的屏幕,还可以访问连接到您电脑的所有设备。
我相信这比仅限于使用 Windows 7 手机(尤其是 xna 游戏)要理想得多。
希望这能带来一些启发。
Think you are a bit unclear about the whole microsoft and supporting cameras.
Microsoft released not too long ago Expression Encoder 4 which allows you not only to video screen capture your screen but as well access all devices connected to your pc.
I would believe this would be much more ideal then being restrained to only using a windows 7 phone especially for an xna game.
Hope this sheds some light.
现在,您可以使用 FileSink 将视频从 CaptureSource(如 VideoCaptureDevice)保存到文件中。
Nowadays you can use FileSink to save video from a CaptureSource like VideoCaptureDevice into a file.