I am creating a universal Windows application. I want the user to be able to upload the image, and the user should be able to take it in place and send it. It works for me using api MediaCapture. However, I can only use one camera, for example, if my phone has front and rear cameras, only the front camera is used. How can I switch the camera that is in use?
I read something about using something like this:
private static async Task<DeviceInformation> GetCameraID(Windows.Devices.Enumeration.Panel desired) { DeviceInformation deviceID = (await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture)) .FirstOrDefault(x => x.EnclosureLocation != null && x.EnclosureLocation.Panel == desired); return deviceID; }
However, this always returns null for me, since the device identifier is always zero.
Alternatively, is it possible to control an application that takes a snapshot and returns the captured image to my application? I found the following, but it does not work for Windows Universal applications: http://msdn.microsoft.com/en-us/library/windows/apps/hh394006(v=vs.105).aspx
source share