应用phonegap从相册里面获取照片

ca88会员登录中心

``myImage.src=imageURI;

 

``<meta charset=``"UTF-8"``>

``document.addEventListener(``"deviceready"``, onDeviceReady, ``false``);

 

``</body>

 

 

 

``<img style=``"display:none;" id=``"myImage" src=``""``/>

``//失败回调

 

<html>

``//获取照片

``</head>

``}

``function onDeviceReady() {

 

 

``//成功回调

<!DOCTYPE html>

``navigator.camera.getPicture(onPhotoSuccess,onPhotoFail,{quality:``50``,sourceType:source});

``function onPhotoFail(message){

``<body>

``</script>

``<script type=``"text/javascript" charset=``"UTF-8"``>

``}

``function getPhoto(source){

``var myImage=document.getElementById(``'myImage'``);

</html>

``<button onclick=``"getPhoto(Camera.PictureSourceType.PHOTOLIBRARY);"``> From Photo Library</button><br>

``alert(``'Failed beacause:'``+message);

ca88会员登录中心, 

``<title>Take a Photo</title>

``<script type=``"text/javascript" charset=``"UTF-8" src=``"cordova.js"``></script>

``<head>

``myImage.style.display=``'block'``;

``function onPhotoSuccess(imageURI){

``}

``}

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图