是否可以从 xaml 页面内部使用相机? [英] Is it possible use camera inside from a xaml page?

查看:30
本文介绍了是否可以从 xaml 页面内部使用相机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以在自定义 xaml 页面的一小块屏幕内打开相机.我不确定 WP7 API 是否支持这样的东西.

I was wondering if it's possible open camera inside a small piece of screen from a custom xaml page. I'm not sure if WP7 API support stuff like that.

版本:Windows Phone 7.5 Mango

Version: Windows Phone 7.5 Mango

推荐答案

您可以将相机用作应用程序中的实时图像数据源.这在 Windows 代码示例中有详细记录电话 MSDN 页面.演示代码生成一个简单的应用程序,如下所示:

You can use the camera as a live source of image data in your application. This is well documented in the Code Samples for Windows Phone MSDN page. The demo code produces a simple application as follows:

您只需在 XAML 中创建画笔:

You simply create a brush in XAML:

<VideoBrush x:Name="viewfinderBrush" />

并在代码隐藏中将其连接到您的相机:

And wire it up to your camera in code-behind:

 viewfinderBrush.SetSource(cam);

这篇关于是否可以从 xaml 页面内部使用相机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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