0
私はphonegapを使ってアプリケーションをビルドしています。私はビルドしています。私はアプリを開いてカメラコントロールを見るとカメラが点灯します。一度キャプチャした画像は、私のアプリの背景画像として設定する必要があります画像をキャプチャします。どうやってやるの?phonegapを使用して画像を撮影して背景に設定する方法
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
navigator.camera.getPicture(onSuccess, onFail, {
quality: 50,
destinationType: Camera.DestinationType.FILE_URI,
encodingType: Camera.EncodingType.JPEG,
saveToPhotoAlbum: true,
showOverlay: false
});
function onSuccess(imageURI) {
var image = document.getElementById('myImage');
image.src = imageURI;
alert(image.src);
document.body.style.backgroundImage = "url(image.src)";
}
function onFail(message) {
/*alert("you are closing the camera")*/
}
}