MediaCapture class provides the functionalities for dealing with all kind of Audio and Video capturing in Windows Store Application. Using the properties and methods provided with this class, it is quite easy to capture audio and video . This Tip talk about simple steps to start building application using Camera in your windows store app.
Step 1 : Select
Capabilities in your
Package.appxmanifest file .
Step 2 : Define the CaptureElement in XAML
Step 3: Initialize an object of MediaCapture class. You can find this under Windows. Media.Capture namespace.
MediaCapture mediaCapture = new MediaCapture(); await mediaCapture.InitializeAsync();
InitializeAsync() method, initialize the mediaCapture object using default settings ( MediaCaptureInitializationSettings)
Related Post :
Step 4 : Once the mediaCapture object initialized you can set the Source property of CaptureElement with initialized mediaCapture instance.
Step 5. Finally, Start the Video Preview by
and Stop it using
By just following above steps, you should be able to see the video preview in your application. You just need to write the code block on approprite event handler, such as click on “
Start Preview”, “
Stop Preview” button on UI.