触发音量按钮拍照UWP [英] Trigger volume buttons to take picture UWP

查看:61
本文介绍了触发音量按钮拍照UWP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用自拍杆,但是由于Windows 10摄像头应用程序无法提供使用它拍照和录制视频的功能,我想知道当用户将音量调高时是否有可能触发和处理和/或UWP应用程序中的向下按钮

I try to use a selfie stick, but as windows 10 camera app does not provide the possibility to take picture and record video with it, I was wondering if there is a possibility to trigger and handle when the user presses the volume up and/or down button inside an UWP app

任何人都可以实现吗?

推荐答案


我想知道当用户按下UWP应用中的音量增大和/或减小按钮时是否有可能触发和处理

I was wondering if there is a possibility to trigger and handle when the user presses the volume up and/or down button inside an UWP app

否,硬件音量控件需要特殊的开发许可,如果您是普通开发人员,则无法访问这些硬件控件,可以参考启动,返回,搜索,电源和音量控制行为

No, hardware Volume controls need special permission for development, if you are an ordinary developer, it is not possible to access these hardware controls, you can refer to Start, Back, Search, Power, and Volume control behavior.


我尝试o使用自拍杆,但是由于Windows 10摄像头应用程序无法使用它拍照和录制视频。

I try to use a selfie stick, but as windows 10 camera app does not provide the possibility to take picture and record video with it.

I我不确定为什么自拍棒不支持拍照和录制,有些Windows Phone没有像Lumia 640这样的相机硬件按钮。但是对于像Lumia 950这样的具有相机硬件按钮的设备,相机硬件按钮可在UWP应用中访问。如您从官方基本相机应用示例中所见,它将为Camera的硬件按钮注册事件处理程序,如下所示:

I'm not sure why is selfie stick doesn't support take pictures and record, some windows phones don't have a camera hardware button, like Lumia 640. But for device like Lumia 950 which has a camera hardware button, the camera hardware button is accessible in UWP app. As you can see from the official Basic camera app sample, it registers the event handlers for hardware buttons of Camera like this:

if (ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
{
    HardwareButtons.CameraPressed += HardwareButtons_CameraPressed;
}

使用此API时,您需要引用适用于Universal App的Microsoft Mobile Extension SDK项目中的平台。

When use this API, you need to reference Microsoft Mobile Extension SDK for Universal App Platform in your project.

如果访问摄像头硬件按钮对您而言还不够,我的建议是您可以提交一个请求,要求添加此新功能以通过Windows反馈工具进行开发。

If accessing camera hardware button is not enough for you, my suggestion is that you may submit a request to add this new features for developing through the Windows Feedback tool.

这篇关于触发音量按钮拍照UWP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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