积极答复者
求wp8.1 APPX 开启闪光灯手电筒例子

问题
答案
-
这个在lumia930上能执行,不报错。但是灯就是不亮,什么回事?
你好 H-huihui,
这个是已知的问题,我们从产品组那边得到了合理的解决方案。
部分手机使用上述链接中的代码是可以打开闪光灯的,但是如果要保证对所有设备都支持,必须启动一个视频录制会话, 具体可以查看这个英文贴:https://social.msdn.microsoft.com/Forums/en-US/329c40e7-fa9a-4a27-8347-b4a80100842e/cant-turn-on-lumia-1520-wp-81-flashlight-use-videodevicecontrollertorchcontrol?forum=wpdevelop
Alan_Yao 提供了关键代码:
if (mc.VideoDeviceController.TorchControl.Supported) { // But wait, for this to work with Blue camera drivers, we have to Start a recording session // Create video encoding profile as MP4 var videoEncodingProperties = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.Vga); // Start Video Recording var videoStorageFile = await KnownFolders.VideosLibrary.CreateFileAsync("tempVideo.mp4", CreationCollisionOption.GenerateUniqueName); await mc.StartRecordToStorageFileAsync(videoEncodingProperties, videoStorageFile); // Turn on Torch mc.VideoDeviceController.TorchControl.Enabled = true; }
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- 已建议为答案 Franklin ChenMicrosoft employee, Moderator 2014年12月3日 5:31
- 已标记为答案 Franklin ChenMicrosoft employee, Moderator 2014年12月8日 14:29
全部回复
-
你好。
博客园有针对WP 8.1的手电筒开发讲解,从实现思路到代码都比较完整,可供参考!
http://www.cnblogs.com/tcjiaan/p/4034474.html
希望我的答案能帮助更多的人。
-
你好。
博客园有针对WP 8.1的手电筒开发讲解,从实现思路到代码都比较完整,可供参考!
http://www.cnblogs.com/tcjiaan/p/4034474.html
希望我的答案能帮助更多的人。
-
这个在lumia930上能执行,不报错。但是灯就是不亮,什么回事?
你好 H-huihui,
这个是已知的问题,我们从产品组那边得到了合理的解决方案。
部分手机使用上述链接中的代码是可以打开闪光灯的,但是如果要保证对所有设备都支持,必须启动一个视频录制会话, 具体可以查看这个英文贴:https://social.msdn.microsoft.com/Forums/en-US/329c40e7-fa9a-4a27-8347-b4a80100842e/cant-turn-on-lumia-1520-wp-81-flashlight-use-videodevicecontrollertorchcontrol?forum=wpdevelop
Alan_Yao 提供了关键代码:
if (mc.VideoDeviceController.TorchControl.Supported) { // But wait, for this to work with Blue camera drivers, we have to Start a recording session // Create video encoding profile as MP4 var videoEncodingProperties = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.Vga); // Start Video Recording var videoStorageFile = await KnownFolders.VideosLibrary.CreateFileAsync("tempVideo.mp4", CreationCollisionOption.GenerateUniqueName); await mc.StartRecordToStorageFileAsync(videoEncodingProperties, videoStorageFile); // Turn on Torch mc.VideoDeviceController.TorchControl.Enabled = true; }
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.- 已建议为答案 Franklin ChenMicrosoft employee, Moderator 2014年12月3日 5:31
- 已标记为答案 Franklin ChenMicrosoft employee, Moderator 2014年12月8日 14:29