|
我用getPicture+imageClip,截取图片的时候,图片很模糊,逸天和各位大师看下怎么回事
function getNewPic() {
api.getPicture({
sourceType: 'library',
encodingType: 'jpg',
mediaValue: 'pic',
destinationType: 'url',
allowEdit: true,
quality: 100,
targetWidth: 100,
targetHeight: 100,
saveToPhotoAlbum: false
}, function (ret, err) {
if (ret && ret.data != '') {
var imageClip = api.require('imageClip');
imageClip.open({
path: ret.data,
clipRect: {
x: 20,
y: 120,
w: 300,
h: 300
}
},
function (ret, err) {
if (ret.status) {
//功能frame控制保存和关闭功能
api.openFrame({
name: 'modify_user_save_img',
url: '../../html/login/saveImg.html',
rect: {
x: 20,
y: 10,
w: 60,
h: 35
},
bounces: false,
opaque: false,
bgColor: 'rgba(0,0,0,0.0)'
});
api.openFrame({
name: 'modify_user_close_img',
url: '../../html/login/closeImg.html',
rect: {
x: window.innerWidth - 80,
y: 10,
w: 60,
h: 35
},
bounces: false,
opaque: false,
bgColor: 'rgba(0,0,0,0.0)'
});
} else {
alert(JSON.stringify(err));
}
});
} else {
// api.alert({msg: err.msg});
}
});
} |
|