在Ubuntu平台上创建Cordova Camera HTML5应用

/** * Wait before the DOM has been loaded before initializing the Ubuntu UI layer */window.onload = function () {var UI = new UbuntuUI(); // This must be called after window is loadedUI.init();document.addEventListener("deviceready", function() {if (console && console.log)console.log('Platform layer API ready');//hide the loading div and display the loaded divdocument.getElementById("loading").style.display = "none";document.getElementById("loaded").style.display = "block";// event listener to take pictureUI.button("click").click( function() {navigator.camera.getPicture(onSuccess, onFail, {quality: 100,targetWidth: 400,targetHeight: 400,destinationType: Camera.DestinationType.DATA_URL,correctOrientation: true});console.log("Take Picture button clicked");}); // "click" button event handler}, false); // deviceready event handler}; // window.onload event handler// show new picture in html and logfunction onSuccess(imageData) {var image = document.getElementById('image');image.src = "data:image/jpeg;base64," + imageData;image.style.margin = "10px";image.style.display = "block";}// log failure messagefunction onFail(message) {console.log("Picture failure: " + message);}

,再怎么风光明媚的自家山川,

在Ubuntu平台上创建Cordova Camera HTML5应用

相关文章:

你感兴趣的文章:

标签云: