These are worldcup days so the posts will be short and at directly to the foot. Today I was in need to work with the camera in a UWP App; and of course, this requires a few lines of code, but I know they can be just one line of code. I remembered that the latest version of Windows Community Toolkit V 3.0 We Allowed reduce the code to the following
<controls:CameraPreview x:Name=”CameraPreviewControl” />
await CameraPreviewControl.StartAsync(); ();
CameraPreviewControl.CameraHelper.FrameArrived += CameraPreviewControl_FrameArrived;
Incredibly Easy! Some time ago I wrote about other features in previous versions. In example: we could work with Bluetooth Low Energy also with a couple of lines of code, and as in version 1.2 this Toolkit It helped us to use the correct way the pool of connections HttpClient.
Important: If you haven’t read this post, you should. The class HttpClient may give you some headaches if you do not know how it works internally.
So, today with only 3 lines I have integrated the camera to my App and I can still see the surprises that leaves the World Cup!
Greetings @ Burlington
PS: If you are a parent, you must know Pusheen The Cat
My blogs on Community Toolkit
- UWP Community Toolkit 1.5. New BlueTooth LE features, new controls and more …
- UWP Community Toolkit 1.2. With connection pooling support for HttpRequests !
- UWP Community Toolkit nice help and assets if you are developing Windows 10 Apps