Following on from this series of posts, it’s been a little while since I had a chance to continue rebuilding my QR code scanning app;
and in the last post I’d been trying to replace the built-in camera controls that my application had previously offered but which weren’t looking too nice on Windows 10 with a simpler control that I built myself which allowed the user to adjust purely the focus on a device that allows for it.
This hasn’t been too difficult to build, it was really just a matter of wiring up the radial control that I built in the previous posts to the various properties and methods that live within the MediaCapture class and, specifically, using its VideoDeviceController property in order to check the FocusControl property and then try and make use of;
- Supported to see whether we can control focus at all.
- Min, Max to figure out what range we can use.
- Step to figure out what increments we can set.
- SetValueAsync to change the focus.
- SetPresetAsync to toggle between manual and auto focus mode.
That all seems to work out reasonably well in that on a device like my Surface Pro 3, I don’t get the option to control focus as per the video below;
whereas if I run it on my Dell Venue Pro 8 then I do get the option to control focus and I can control it manually as in this video below (NB: this video was made by screen capturing my Surface Pro 3 and then opening its camera app and pointing it at the Dell Venue Pro 8 which was then running my kwiQR app which then opened up its camera – it all gets a bit spooky!);
but, ultimately, that all seems to be working reasonably well.
My next step was to, for the first time, see if I could deploy this onto a phone…