Skip to content

Instantly share code, notes, and snippets.

@seksenov
Created October 6, 2015 01:34
Show Gist options
  • Save seksenov/9f9c2e6881d09116cdb3 to your computer and use it in GitHub Desktop.
Save seksenov/9f9c2e6881d09116cdb3 to your computer and use it in GitHub Desktop.
function cameraCapture() {
if(typeof Windows != 'undefined') {
var captureUI = new Windows.Media.Capture.CameraCaptureUI();
//Set the format of the picture that's going to be captured (.png, .jpg, ...)
captureUI.photoSettings.format = Windows.Media.Capture.CameraCaptureUIPhotoFormat.png;
//Pop up the camera UI to take a picture
captureUI.captureFileAsync(Windows.Media.Capture.CameraCaptureUIMode.photo).then(function (capturedItem) {
// Do something with the picture
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment