实际上,复制画布数据的正确方法是将旧画布传递到新的空白画布。试试这个功能。function cloneCanvas(oldCanvas) { //create a new canvas var newCanvas = document.createElement('canvas'); var context = newCanvas.getContext('2d'); //set dimensions newCanvas.width = oldCanvas.width; newCanvas.height = oldCanvas.height; //apply the old canvas to the new one context.drawImage(oldCanvas, 0, 0); //return the new canvas return newCanvas;}使用getImageData用于像素数据访问,而不用于复制画布。使用它进行复制非常缓慢,并且很难在浏览器上进行。应该避免。