$cordovaCamera为透明PNG添加黑色背景

$cordovaCamera为透明PNG添加黑色背景,cordova,camera,base64,transparency,cordova-plugins,Cordova,Camera,Base64,Transparency,Cordova Plugins,插件: 我可以用它成功地获取ImageURI,但问题是当我选择带有透明背景的PNG文件时,它会变成黑色。如果有用的话,我将把imageURI转换成blob imageUri = "data:image/png;base64," + imageData; dataURItoBlob = function(dataURI) { var binary = atob(dataURI.split(',')[1]); var mimeString = dataURI.split(','

插件:

我可以用它成功地获取ImageURI,但问题是当我选择带有透明背景的PNG文件时,它会变成黑色。如果有用的话,我将把imageURI转换成blob

imageUri = "data:image/png;base64," + imageData;

  dataURItoBlob = function(dataURI) {
    var binary = atob(dataURI.split(',')[1]);
    var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];
    var array = [];
    for (var i = 0; i < binary.length; i++) {
      array.push(binary.charCodeAt(i));
    }
    return new Blob([new Uint8Array(array)], {
      type: mimeString
    });
  };
imageUri=“data:image/png;base64”+imageData;
dataURItoBlob=函数(dataURI){
var binary=atob(dataURI.split(',)[1]);
var mimeString=dataURI.split(',')[0]。split(':')[1]。split(';')[0];
var数组=[];
对于(var i=0;i
你找到解决方案了吗?你找到解决方案了吗?你们中有人找到解决方案了吗?
imageUri = "data:image/png;base64," + imageData;

  dataURItoBlob = function(dataURI) {
    var binary = atob(dataURI.split(',')[1]);
    var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];
    var array = [];
    for (var i = 0; i < binary.length; i++) {
      array.push(binary.charCodeAt(i));
    }
    return new Blob([new Uint8Array(array)], {
      type: mimeString
    });
  };