CameraCaptureUI
The CameraCaptureUI
class enables you to launch an experience similar to the built-in Camera app (in a more limited mode and directly inside your app) in order to easily capture a photo or video. For the user, the result is like choosing the Camera app inside the Windows file picker, except it’s full-screen and there’s a back button on the top left instead of a cancel button on the bottom right.
Capturing a Photo
Assuming you have an Image
named image
on your Page
:
<Image Name="image"/>
the following code-behind launches the camera UI in photo-taking mode:
async Task CapturePhoto(){ CameraCaptureUI camera = new CameraCaptureUI(); // Get a JPEG image from the camera StorageFile file = await
Get XAML Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.