When I teach classes at Microsoft, I often precede a juicy tidbit of information or code sample with the statement “Here’s a good interview question for you.” Well, here’s a good interview question for you – especially if you want the interviewee out of your office as fast as humanly possible. How do you get a reference to a front-facing or back-facing camera on a Surface RT?
It’s easy to enumerate camera devices in WinRT, but distinguishing between front-facing and back-facing cameras requires a little more work. Here are three magic lines of code that will identify the front-facing camera (if it exists) and the back-facing camera (if it exists):
var devices = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture); var front = devices.FirstOrDefault(x => x.EnclosureLocation != null && x.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Front); var back = devices.FirstOrDefault(x => x.EnclosureLocation != null && x.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Back);
This code works like a champ on a Surface RT, and will presumably work on other tablets as well.
Cloud management is difficult to do manually, especially if you work with multiple cloud…
Azure’s scalable infrastructure is often cited as one of the primary reasons why it's the…
https://www.youtube.com/watch?v=wDzCN0d8SeA Watch our "Unlocking the Power of AI in your Software Development Life Cycle (SDLC)"…
FinOps is a strategic approach to managing cloud costs. It combines financial management best practices…
Using Kubernetes with Azure combines the power of Kubernetes container orchestration and the cloud capabilities…
In the intricate landscape of modern business, compliance is both a cornerstone of operational integrity…
View Comments
PingBack from http://www.alvinashcraft.com/2012/12/13/dew-drop-december-13-2012-1462/