//将图片转换成base64 function getBase64Image(url, callback){ var canvas = document.createElement('canvas'), ctx = canvas.getContext('2d'), img = new Image(); //为了解决跨域,可以直接img.crossOrigin=''就能解决图片跨域问题 img.crossOrigin = 'xes'; img.onload = function(){ canvas…