mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
Update camera.android.ts
This commit is contained in:
@ -44,9 +44,9 @@ export var takePicture = function (options?): Promise<any> {
|
|||||||
appModule.android.onActivityResult = previousResult;
|
appModule.android.onActivityResult = previousResult;
|
||||||
|
|
||||||
if (requestCode === REQUEST_IMAGE_CAPTURE && resultCode === android.app.Activity.RESULT_OK) {
|
if (requestCode === REQUEST_IMAGE_CAPTURE && resultCode === android.app.Activity.RESULT_OK) {
|
||||||
|
var imageSource: typeof imageSourceModule = require("image-source");
|
||||||
if (saveToGallery) {
|
if (saveToGallery) {
|
||||||
resolve(picturePath);
|
resolve({image:imageSource.fromFile(picturePath) ,path:picturePath});
|
||||||
} else {
|
} else {
|
||||||
var options = new android.graphics.BitmapFactory.Options();
|
var options = new android.graphics.BitmapFactory.Options();
|
||||||
options.inJustDecodeBounds = true;
|
options.inJustDecodeBounds = true;
|
||||||
@ -89,8 +89,7 @@ export var takePicture = function (options?): Promise<any> {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var imageSource: typeof imageSourceModule = require("image-source");
|
resolve({image:imageSource.fromNativeSource(scaledSizeImage), path:picturePath});
|
||||||
resolve(imageSource.fromNativeSource(scaledSizeImage), picturePath);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user