CameraCaptureUI.PhotoSettings | photoSettings property

Applies to Windows only

Provides settings for capturing photos. The settings include aspect ratio, image size, format, resolution, and whether or not cropping is allowed by the user interface (UI).

Syntax


var photoSettings = cameraCaptureUI.photoSettings;

Property value

Type: CameraCaptureUIPhotoCaptureSettings

An object containing settings for capturing photos.

Examples

The following example shows how to use the PhotoSettings properties. These settings allow the user to crop the .jpeg photo and keep the desired aspect ratio.


// Takes a photo with specified settings.
function takePhoto() {
    var captureUI = new Windows.Media.Capture.CameraCaptureUI();
    captureUI.photoSettings.allowCropping = true;
    captureUI.photoSettings.croppedAspectRatio.height = 3;
    captureUI.photoSettings.croppedAspectRatio.width = 4;
    captureUI.photoSettings.croppedSizeInPixels.height = 0;
    captureUI.photoSettings.croppedSizeInPixels.width = 0;
    captureUI.photoSettings.format = Windows.Media.Capture.CameraCaptureUIPhotoFormat.jpeg;
    captureUI.photoSettings.maxResolution = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution.highestAvailable;
    captureUI.captureFileAsync(Windows.Media.Capture.CameraCaptureUIMode.photo).then(function (capturedItem) {
        if (capturedItem) {
            document.getElementById("message").innerHTML = "User captured a photo."
        }
        else {
            document.getElementById("message").innerHTML = "User didn't capture a photo."
        }
    });
}


Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

None supported

Namespace

Windows.Media.Capture
Windows::Media::Capture [C++]

Metadata

Windows.winmd

Capabilities

webcam
microphone

See also

CameraCaptureUI

 

 

Show:
© 2014 Microsoft. All rights reserved.