2017-03-25 6 views
0

私は1つのカメラアプリを使用しています。その中で私はphototを撮った後、その画像をデータuriに変換してからdbに送信する必要があります。私はデシベルにこの$scope.imgUrlを送信したときiamgeをデータuri ionicに変換するには

function opencamer() { 

    console.log("camer open"); 
    Camera.getPicture().then(function(imageURI) { 
     console.log(imageURI); 
     $scope.lastPhoto = imageURI; 
     $scope.imgUrl = "data:image/jpeg;base64," + imageURI; 
    }, function(err) { 
     console.err(err); 
    }, { 
     quality: 75, 
     targetWidth: 320, 
     targetHeight: 320, 
     saveToPhotoAlbum: false 
    }); 


} 

しかし:ここ

は私がやったことです。私はデータを得ることができませんでしたuri.pleaseは私がこれを解決する方法を助けます。

私は3時間以上トラックです。解決策を見つけることができません。私を助けてください。ここで

おかげ

enter image description here

答えて

0

は、作業コード

$scope.opencamer= 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 (imageURI)     { 
        $scope.lastPhoto = imageURI; 
       $scope.imgUrl = "data:image/jpeg;base64," + imageURI;  


       }, function (err) { 
        // An error occured. Show a message to the user 
       }); 
      } 

あるコントローラに代わり$scope.imgUrl

+0

のあなたのDBに$scope.lastPhotoを送って、私はカメラや$ cordovaCameraを言及する必要があるはずです。 –

+0

今私はカメラを言及しています。その後、私はopencamera.itsをタップするとオープニングしませんか? –

+0

を確認しました。私もプラグインをインストールしました。しかし余りにもカメラは開いていません –

関連する問題