我正在使用Ionic和Cordova创建Instagram克隆.我需要能够拍照或从用户库(已经设置)中选择并在其上放置一个设置图像(就像Snapchat使用的过滤器,但另一个图像不仅仅是文本).但是,我对如何做到这一点感到茫然.
这是抓取图像的功能 -
$scope.open = function () {
init();
PhotoService
.open({
quality : GallerySetting.get('imageQuality'),
allowEdit : GallerySetting.get('imageEdit'),
correctOrientation: GallerySetting.get('imageEdit'),
targetWidth : GallerySetting.get('imageWidth'),
targetHeight : GallerySetting.get('imageHeight'),
saveToPhotoAlbum : GallerySetting.get('imageSaveAlbum')
})
.then(function (resp) {
$scope.data = 'data:image/jpeg;base64,' + resp;
$scope.form.photo = resp;
$ionicModal.fromTemplateUrl('module/gallery/view/gallery.capture.modal.html', {
scope : $scope,
focusFirstInput: true
}).then(function (modal) {
$scope.modal = modal;
$scope.modal.show();
});
$scope.closeModal = function () {
$scope.modal.hide();
$scope.modal.remove();
};
})
.catch(function () {
$state.go('gallery.home');
});
};
Run Code Online (Sandbox Code Playgroud)
对此最好的方法是什么?