我从相机拍摄照片后使用了这个功能。 它总是控制我相同的数据。数据:图像/ PNG; BASE64,iVBORw0KGgoAAAANSUhEUgAAAMgAAAEsCAYAAACG + VY + AAAABHNCSVQICAgIfAhkiAAAAQBJREFUeJztwTEBAAAAwqD1T20LL6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgIcBqtkAAcZpLS4AAAAASUVORK5CYII =
function onPhotoURISuccess(imageURI) {
var imageObj = new Image();
imageObj.src=imageURI;
var canvas = document.createElement("canvas");
canvas.setAttribute('width',200);
canvas.setAttribute('height',300);
var ctx = canvas.getContext("2d");
ctx.drawImage(imageObj, 29, 0, 142, 300);
var dataURL = canvas.toDataURL();
console.log(dataURL);
}