Freigeben über


Walkthrough: Capturing photos in your Windows 8 application

imageWindows 8 apps easily access all the sensors on a Windows 8 machine. But Windows 8 apps can’t access any sensors on a Windows 8 machine without first asking the user’s permission.

Asking Permission

Windows 8 apps are safe. That’s fundamental. Where desktop apps could (and can) do whatever the developer wants, Windows 8 apps are limited only to what the user allows.

Developers ask for device access by the application manifest. This XML file is in every Windows 8 app. It is manipulated by the GUI editor or notepad (for the die hard).

The manifest is how applications tell the operating system what sensors it intends to use. Just the manifest is not enough. Once requested, the operating system will verify access with the user first. 

image

Important note: checking webcam lets you capture photos. However, to capture video (including access to the vide stream) you need to ask for webcam and microphone. That’s just how it works.

Capture a Photo

Why do you want to capture a photo? There are a million reasons. Maybe you want to apply filters and effects. Maybe you want to update the user’s account photo. Or, maybe something else. Whatever reason, you can!

Read the whole article here.