我想打开Lumia 1520上的手电筒。我尝试使用此代码但不起作用:
if (captureManager.VideoDeviceController.TorchControl.Supported)
{
var videoEncodingProperties = MediaEncodingProfile.CreateMp4(VideoEncodingQuality.Vga);
StorageFolder folder = KnownFolders.VideosLibrary;
StorageFile videoStorageFile;
videoStorageFile = await folder.CreateFileAsync("tempVideo.mp4", CreationCollisionOption.GenerateUniqueName);
Capture.Source = captureManager;
await captureManager.StartRecordToStorageFileAsync(videoEncodingProperties, videoStorageFile);
captureManager.VideoDeviceController.TorchControl.Enabled = true;
int i;
for (i = 0; i < 3; i++)
{
await System.Threading.Tasks.Task.Delay(TimeSpan.FromSeconds(1));
}
captureManager.VideoDeviceController.TorchControl.Enabled = false;
captureManager.Dispose();
}
我试过这篇文章Toggle flashlight in Windows Phone 8.1,但没有用。 支持FlashControl和TorchControl。它没有错误也没有光。