我将使用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');
});
};
什么是最佳方法?