mui拍照

方法:1.  getCamera()      获取摄像头管理对象

   2.  captureImage()     进行拍照操作

   3.  startVideoCapture()   调用摄像头进行摄像操作

   4.  stopVideoCapture()    结束摄像操作

例子:

function getImage() {
var c = plus.camera.getCamera();    //获取摄像头对象
c.captureImage(function(e) {      //进行拍照
plus.io.resolveLocalFileSystemURL(e, function(entry) {   //通过URL参数获取目录对象或文件对象
var imgSrc = entry.toLocalURL();   //拿到图片路径
upload(imgSrc);
}, function(e) {
mui.toast("读取拍照文件错误:" + e.message);
//console.log("读取拍照文件错误:" + e.message);
});
}, function(s) {
console.log("error" + s);
}, {
filename: "_doc/camera/"
})
}

猜你喜欢

转载自www.cnblogs.com/1211dani/p/10402625.html
MUI