mirror of
https://github.com/apache/cordova-plugin-camera.git
synced 2025-01-31 12:42:50 +08:00
change 'case' to else-if. This closes #113
This commit is contained in:
parent
b8a68af63f
commit
a030c52f7f
@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
/*jshint unused:true, undef:true, browser:true */
|
||||
/*global Windows:true, URL:true, module:true, require:true */
|
||||
/*global Windows:true, URL:true, module:true, require:true, WinJS:true */
|
||||
|
||||
|
||||
var Camera = require('./Camera');
|
||||
@ -701,25 +701,18 @@ function takePictureFromCameraWindows(successCallback, errorCallback, args) {
|
||||
var UIMaxRes = WMCapture.CameraCaptureUIMaxPhotoResolution;
|
||||
var totalPixels = targetWidth * targetHeight;
|
||||
|
||||
switch (true) {
|
||||
case (totalPixels <= 320 * 240):
|
||||
maxRes = UIMaxRes.verySmallQvga;
|
||||
break;
|
||||
case (totalPixels <= 640 * 480):
|
||||
maxRes = UIMaxRes.smallVga;
|
||||
break;
|
||||
case (totalPixels <= 1024 * 768):
|
||||
maxRes = UIMaxRes.mediumXga;
|
||||
break;
|
||||
case (totalPixels <= 3 * 1000 * 1000):
|
||||
maxRes = UIMaxRes.large3M;
|
||||
break;
|
||||
case (totalPixels <= 5 * 1000 * 1000):
|
||||
maxRes = UIMaxRes.veryLarge5M;
|
||||
break;
|
||||
default:
|
||||
maxRes = UIMaxRes.highestAvailable;
|
||||
break;
|
||||
if (totalPixels <= 320 * 240) {
|
||||
maxRes = UIMaxRes.verySmallQvga;
|
||||
} else if (totalPixels <= 640 * 480) {
|
||||
maxRes = UIMaxRes.smallVga;
|
||||
} else if (totalPixels <= 1024 * 768) {
|
||||
maxRes = UIMaxRes.mediumXga;
|
||||
} else if (totalPixels <= 3 * 1000 * 1000) {
|
||||
maxRes = UIMaxRes.large3M;
|
||||
} else if (totalPixels <= 5 * 1000 * 1000) {
|
||||
maxRes = UIMaxRes.veryLarge5M;
|
||||
} else {
|
||||
maxRes = UIMaxRes.highestAvailable;
|
||||
}
|
||||
|
||||
cameraCaptureUI.photoSettings.maxResolution = maxRes;
|
||||
|
Loading…
Reference in New Issue
Block a user