0
我不明白爲什麼這是行不通的.. 無法檢查這在諾基亞模擬器,因爲它不模擬相機.. 和手機應用程序或者崩潰或只是不帶任何圖片 我嘗試了Base64方法和imageURI方法(在html頁面上使用不同的按鈕)使用相機api與phonegap上symbian
這是javascript(相機的重複js的原因是嘗試不同的方法):
function camera(){
$('#showpic').css('display','block').html("getting an image");
navigator.camera.getPicture(camerasuccess,camerafail,null);
};
function camerasuccess(imageBASE) {
$('#showpic').css('display','block').html("we have an image");
var imgsrc = "data:image/jpeg;base64,"+imageBASE[0];
$('#imageplace').html('<img src ="'+imgsrc+'"/>');
//var useimg = document.getElementById('useimage');
//
//useimg.style.display = 'block';
//useimg.src = "data:image/jpeg;base64,"+imageBASE;
}
function camerafail(error) {
$('#showpic').css('display','block').html("some error:"+error);
};
function camera2(){
$('#showpic').css('display','block').html("getting an image");
navigator.camera.getPicture(camera2success,camerafail,null);
};
function camera2success (imageURI){
$('#showpic').css('display','block').html("we have an image");
$('#debug').html(imageURI[0]);
if (!imageURI[0]) {
$('#debug').html("no imageURI here");
}
$('#imageplace').html('<img src ="'+imageURI[0]+'"/>');
這是標記(這裏也是遺留的dif ferent接近我了):
<div id = "camera">
<input type = "button" id = "camera" value = "base">
<input type = "button" id = "camera2" value = "imageURi"></br>
<span id = "showpic" style = "display:none;">showpic</span><br/>
<span id = "debug"></span></br>
<div id = "imageplace"></div></br>
<img id = "useimage" style = "display:none; width:60px; height:60px " src = ''/>
</div>
另一個通知:如果有任何意義,那麼你應該知道,我不使用make關閉WGZ文件,只是壓縮了www文件夾,並改變結局WGZ,最js的功能(包括地理位置)工作正常。