I've created a WinForms (C#) application and I have to add support for the built-in flash. The device is Tablet PC running x64 architecture Windows 10 Professional (common Windows 10). Is there any way to do that? My application captures video from a built-in camera - I'm using OpenCV Sharp to do that, but I can't find any possibility to use a built-in flashlight. I need just manually turn on and off the light. I've found a lot of examples but it is possible only through UWP which I can't add to WinForms in any way. Does anyone know the way to use the built-in flashlight in WinForms Application?
Windows API can be used in any non-UWP-C#-project by adding UwpDesktog NuGet Package and adding these references:
c:\Program Files (x86)\Windows Kits\10\References\Windows.Foundation.FoundationContract\1.0.0.0\Windows.Foundation.FoundationContract.winmd c:\Program Files (x86)\Windows Kits\10\References\Windows.Foundation.UniversalApiContract\1.0.0.0\Windows.Foundation.UniversalApiContract.winmd c:\Program Files (x86)\Windows Kits\10\UnionMetadata\Facade\Windows.WinMD c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETCore\v4.5\System.Runtime.WindowsRuntime.dll
Then you can turn on flashlight using MediaCaptur from UWP.