Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Camera detection in windows 8 [closed]

Tags:

c#

windows-8

I am developing an app in windows 8 that requires camera to capture picture. So what I need to do to know whether camera is present(Suppose assume that desktop doesn't have webcam, while windows 8 tablet has a camera), so I only need to show controls to show camera when camera is present on the device.

like image 276
nucleons Avatar asked Mar 08 '26 00:03

nucleons


1 Answers

You need to use this API: JS:

Windows.Devices.Enumeration.DeviceInformation.findAllAsync(Windows.Devices.Enumeration.DeviceClass.videoCapture).done(yourHandler);

C#:

var interfaces = await DeviceInformation.FindAllAsync(selector, null); 
foreach(DeviceInformation devInfo in interfaces) { /* stuff */ }

This has more information on the other aspects of this API

Since you are using c#, this sample will be more specific.

like image 62
Dominic Hopton Avatar answered Mar 09 '26 14:03

Dominic Hopton



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!