无法找到 ChooserEventArgs 类
我想打开 Windows Phone 7 相机,拍一张快照,然后操作该照片。但问题是,当我尝试覆盖 OnChooserReturn
函数时,当我想捕获从我使用的相机返回的内容时,它也会给我错误没有找到合适的方法来覆盖
这:
ChooserEventArgs<PhotoResult> args = new ChooserEventArgs<PhotoResult>()
它给了我错误找不到类型或命名空间名称'ChooserEventArgs'(您是否缺少using指令或程序集引用?)
尽管我正在使用这两个指令
using Microsoft.Phone.Controls;
using Microsoft.Phone.Tasks;
问题是什么我该如何解决这些问题?
I want to open windows phone 7 camera, take a snap and then manipulate that picture. But the problem is when I try to override the OnChooserReturn
function it gives me the error no suitable method found to override
also when I want to capture what returns from the camera I use this :
ChooserEventArgs<PhotoResult> args = new ChooserEventArgs<PhotoResult>()
It gives me the error The type or namespace name 'ChooserEventArgs' could not be found (are you missing a using directive or an assembly reference?)
although I am using these two directives
using Microsoft.Phone.Controls;
using Microsoft.Phone.Tasks;
What is the problem and how can I solve these issues?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
听起来您正在尝试使用旧的 SDK,或者至少是基于过时的 SDK 的指南。要让手机启动相机,然后使用
CameraCaptureTask
引用捕获的图像。您将需要以下使用语句:在代码中的某个位置(可能是在按钮单击事件中),您执行此操作来启动相机:
然后像这样处理已完成的事件(假设您有一个名为 image 的图像控件):
此处的文档: http://msdn。 microsoft.com/en-us/library/microsoft.phone.tasks.cameracapturetask(v=VS.92).aspx
It sounds like you are trying to use an old SDK or at least a guide based on an outdated SDK. To have the phone launch the Camera and then to reference the captured image you use the
CameraCaptureTask
. You will need the following Using statements:Somewhere in your code (presumably in a button click event) you do this to launch the camera:
Then you handle the completed event like this (assuming you have an Image control named image):
Documentation Here: http://msdn.microsoft.com/en-us/library/microsoft.phone.tasks.cameracapturetask(v=VS.92).aspx