InfraredTorchControl.SupportedModes 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
SupportedModes 属性用于找出红外 LED 支持的模式。
public:
property IVectorView<InfraredTorchMode> ^ SupportedModes { IVectorView<InfraredTorchMode> ^ get(); };
IVectorView<InfraredTorchMode> SupportedModes();
public IReadOnlyList<InfraredTorchMode> SupportedModes { get; }
var iVectorView = infraredTorchControl.supportedModes;
Public ReadOnly Property SupportedModes As IReadOnlyList(Of InfraredTorchMode)
属性值
支持的 InfraredTorchModes 的只读列表。
示例
using Windows.Media.Capture;
MediaCapture mediaCapture = new MediaCapture();
public MainPage()
{
this.InitializeComponent();
}
protected override async void OnNavigatedTo(NavigationEventArgs e)
{
await mediaCapture.InitializeAsync();
// Preview is Windows.UI.Xaml.Controls.CaptureElement defined in XAML file
// and used to render camera preview
Preview.Source = mediaCapture;
await mediaCapture.StartPreviewAsync();
if (mediaCapture.VideoDeviceController.InfraredTorchControl.IsSupported)
{
Debug.WriteLine("IR torch supported");
IEnumerable<InfraredTorchMode> supportedModes =
mediaCapture.VideoDeviceController.InfraredTorchControl.SupportedModes;
foreach (InfraredTorchMode supportedMode in supportedModes)
{
Debug.WriteLine($"This infrared LED supports mode {supportedMode}");
}
}
else
{
Debug.WriteLine("IR torch NOT supported");
}
}