0
카메라에 액세스 할 수 있고 이미지를 원격으로 저장할 수도 있지만 업로드하기 전에 이미지를 화면에 표시하고 싶습니다.코르도바에서 카메라에서 찍은 이미지를 표시하는 방법? (Xcode/iOS)
장치 카메라를 여는 기능이다
function capturePhoto() {
navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 10, width: 412, height: 412, correctOrientation: 1, saveToPhotoAlbum: 1});
}
사진을 처음 수행 된 후에 트리거되는 함수이다 :
function uploadImage() {
imageURI = lastImage;
// Get image handle
var smallImage = document.getElementById('smallImage')
smallImage.src = "data:image/jpeg;base64," + imageURI;
var fail, ft, options, params, win;
// callback for when the photo has been successfully uploaded:
var success = function(response) {
//alert(tags);
alert("Photo Saved");
};
// callback if the photo fails to upload successfully.
var fail = function(error) {
alert("An error has occurred: Code = " + error.code);
alert(FileTransferError.CONNECTION_ERR);
};
//FILE UPLOAD SCRIPTS
options = new FileUploadOptions();
options.fileKey = "my_image";
options.fileName = imageURI.substr(imageURI.lastIndexOf('/') + 1);
options.mimeType = "text/plain";
params = {
val1: tags,
val2: location
};
options.params = params;
ft = new FileTransfer();
ft.upload(imageURI, 'http://mysite.com/recieve.php', success, fail, options);
}
이미지가 표시되는 HTML :
<img style="display :none;width:60px;height:60px;" id="smallImage" src="" />
내가 뭔가 잘못 생각하고 있습니다.
smallImage.src = "data:image/jpeg;base64," + imageURI;
하지만 어떻게 수정해야할지 모르겠습니다.
누구나이 방법을 알 수 있습니까?