求wp8.1 APPX 开启闪光灯手电筒例子 RRS feed


  • 这个在lumia930上能执行,不报错。但是灯就是不亮,什么回事?

    你好 H-huihui,


    部分手机使用上述链接中的代码是可以打开闪光灯的,但是如果要保证对所有设备都支持,必须启动一个视频录制会话, 具体可以查看这个英文贴:

    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.

    2014年11月25日 2:11