我正在使用此插件:https://github.com/apache/cordova-plugin-camera
当我们从“相机胶卷”中导入具有alpha(透明)层的PNG时,它将自动添加黑色背景。
如何修改插件(甚至使用JavaScript)以返回带有白色背景的Base64图像?
以下是到目前为止的JavaScript代码:
navigator.camera.getPicture(onPhotoDataSuccess1, onFail, {
quality: 100,
allowEdit: true,
encodingType: Camera.EncodingType.JPEG,
saveToPhotoAlbum: true,
destinationType: destinationType.FILE_URI
});
function onPhotoDataSuccess1(imageURI) {
var img = document.getElementById('image');
img.src = imageURI;
}
function onFail(message) {
console.log('Failed because: ' + message, '');
}