我用相機插件來拍照,我想與大家分享的科爾多瓦社會共享插件,照片,但我不知道怎麼...相機插件+科爾多瓦社會共享
的相機工作正常,並顯示我拍的照片
ionicApp.controller("functions", function($scope, $rootScope, $cordovaCamera) {
$rootScope.takePicture = function() {
var options = {
quality : 75,
destinationType : Camera.DestinationType.DATA_URL,
sourceType : Camera.PictureSourceType.CAMERA,
allowEdit : true,
encodingType: Camera.EncodingType.JPEG,
targetWidth: 300,
targetHeight: 300,
popoverOptions: CameraPopoverOptions,
saveToPhotoAlbum: false
};
$cordovaCamera.getPicture(options).then(function(imageData) {
var image = document.getElementById('myImage');
$rootScope.imgURI = "data:image/jpeg;base64," + imageData;
}, function(err) {
// An error occured. Show a message to the user
});
}
});
ionicApp.controller( 「共享」,功能($範圍,$ cordovaSocialSharing){
$scope.shareAnywhere = function() {
$cordovaSocialSharing.share("#DSTRY_CAM", "#DSTRY_CAM", "www/imagefile.png", "http://DSTRYCAM.COM");
}
});
但我怎麼能把之前拍攝的照片在這個共享功能?我相信正在改變「www/imagefile.png」,但我不知道如何。
謝謝你,和遺憾,我的英文不好
注入rootScope並更改您的www/imagefile:$ rootScope.imgURI – aorfevre
請在下面查看我的答案@ user5028421。 – filipvkovic