漫步雨林
漫步雨林
  • 发布:2016-07-28 11:10
  • 更新:2016-07-28 12:16
  • 阅读:1269

拍摄视频和相片分辨率问题

分类:HTML5+
var cmr = plus.camera.getCamera();  
    var res = cmr.supportedImageResolutions[0];  
    var fmt = cmr.supportedImageFormats[0];  
    console.log("Resolution: "+res+", Format: "+fmt);  
    cmr.captureImage( function( path ){  
            alert( "Capture image success: " + path );    
        },  
        function( error ) {  
            alert( "Capture image failed: " + error.message );  
        },  
        {resolution:res,format:fmt}  
    );

resolution参数设置后,图片依然很大,请教一下各位是怎么解决的,多谢!

2016-07-28 11:10 负责人:无 分享
已邀请:
赵梦欢

赵梦欢 - 专注前端,乐于分享!

cmr.captureImage( successCB, errorCB, option );

参数:
successCB: ( CameraSuccessCallback ) 必选 拍照操作成功的回调函数
errorCB: ( CameraErrorCallback ) 可选 拍照操作失败的回调函数
option: ( CameraOption ) 必选 摄像头拍照参数

interface CameraOption {  
    attribute String filename;  
    attribute String format;  
    attribute String index;  
    attribute PopPosition popover;  
}

摄像头暂不支持resolution参数,可以拍完照片使用图片压缩转换
void plus.zip.compressImage( options, successCB, errorCB);

该问题目前已经被锁定, 无法添加新回复