Hi!
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
Xaml code:
<controls:CameraPreview x:Name=”CameraPreviewControl” />
C# code:
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!
Happy coding!
Greetings @ Burlington
El Bruno
PS: If you are a parent, you must know Pusheen The Cat
References
My blogs on Community Toolkit
13 comments