|
代码就是官方demo,只是加了自定义界面
1.进入拍照界面js
var FNPhotograph = api.require('FNPhotograph');
FNPhotograph.openCameraView({
rect: {
x: 0,
y: y,
w: 'auto',
h: cameraHeight
},
orientation: 'portrait',
useFrontCamera: true,
fixedOn: 'paizhao',
fixed: true
}, function(ret){
if(! ret.status ){
alert("openCameraView异常,请在设置中允许此应用使用相机权限!");
}
});
2.点击拍照按钮
function startpaizhao(){
var picdir = api.fsDir+"/photo";
FNPhotograph.takePhoto({
path: picdir,
qualityValue: 100,
isRotation: false
}, function(ret){
console.log("startpaizhao:"+JSON.stringify(ret));
});
} |
|