mirror of
https://github.com/apache/cordova-plugin-camera.git
synced 2025-01-19 03:42:52 +08:00
one more alias
This commit is contained in:
parent
888a9661fb
commit
b3430e6f80
@ -567,19 +567,20 @@ function takePictureFromCameraWindows(successCallback, errorCallback, args) {
|
|||||||
encodingType = args[5],
|
encodingType = args[5],
|
||||||
allowCrop = !!args[7],
|
allowCrop = !!args[7],
|
||||||
saveToPhotoAlbum = args[9],
|
saveToPhotoAlbum = args[9],
|
||||||
cameraCaptureUI = new Windows.Media.Capture.CameraCaptureUI();
|
WMCapture = Windows.Media.Capture,
|
||||||
|
cameraCaptureUI = new WMCapture.CameraCaptureUI();
|
||||||
|
|
||||||
cameraCaptureUI.photoSettings.allowCropping = allowCrop;
|
cameraCaptureUI.photoSettings.allowCropping = allowCrop;
|
||||||
|
|
||||||
if (encodingType == Camera.EncodingType.PNG) {
|
if (encodingType == Camera.EncodingType.PNG) {
|
||||||
cameraCaptureUI.photoSettings.format = Windows.Media.Capture.CameraCaptureUIPhotoFormat.png;
|
cameraCaptureUI.photoSettings.format = WMCapture.CameraCaptureUIPhotoFormat.png;
|
||||||
} else {
|
} else {
|
||||||
cameraCaptureUI.photoSettings.format = Windows.Media.Capture.CameraCaptureUIPhotoFormat.jpeg;
|
cameraCaptureUI.photoSettings.format = WMCapture.CameraCaptureUIPhotoFormat.jpeg;
|
||||||
}
|
}
|
||||||
|
|
||||||
// decide which max pixels should be supported by targetWidth or targetHeight.
|
// decide which max pixels should be supported by targetWidth or targetHeight.
|
||||||
var maxRes = null;
|
var maxRes = null;
|
||||||
var UIMaxRes = Windows.Media.Capture.CameraCaptureUIMaxPhotoResolution;
|
var UIMaxRes = WMCapture.CameraCaptureUIMaxPhotoResolution;
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case (targetWidth >= 1280 || targetHeight >= 960) :
|
case (targetWidth >= 1280 || targetHeight >= 960) :
|
||||||
cameraCaptureUI.photoSettings.maxResolution = UIMaxRes.large3M;
|
cameraCaptureUI.photoSettings.maxResolution = UIMaxRes.large3M;
|
||||||
@ -602,7 +603,7 @@ function takePictureFromCameraWindows(successCallback, errorCallback, args) {
|
|||||||
|
|
||||||
cameraCaptureUI.photoSettings.maxResolution = maxRes;
|
cameraCaptureUI.photoSettings.maxResolution = maxRes;
|
||||||
|
|
||||||
cameraCaptureUI.captureFileAsync(Windows.Media.Capture.CameraCaptureUIMode.photo).done(function(picture) {
|
cameraCaptureUI.captureFileAsync(WMCapture.CameraCaptureUIMode.photo).done(function(picture) {
|
||||||
if (!picture) {
|
if (!picture) {
|
||||||
errorCallback("User didn't capture a photo.");
|
errorCallback("User didn't capture a photo.");
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user