var formElement2 = document.getElementById("recImage");
formElement2.addEventListener('click', recImagePressed, false);
function recImagePressed(e){
var outputCanvas = document.getElementById("outputCanvas");
outputCtx = outputCanvas.getContext('2d');
outputCTX.draw();
outputCtx.drawImage(canvas2, 0, 0);
}
function draw() {
img = new Image();
**img.src = context2.canvas2.toDataURL();**
fr1 = makeFrame(context2, makeVect(400,0), makeVect(400, 0), makeVect(0, 400));
img.onload = function(){
context2.save();
newPainter = cornerSplit(imagePainter,5);
newPainter(fr1);
context2.restore();
context2.save();
newPainter(flipHorizLeft(fr1));
context2.restore();
context2.save();
newPainter(flipVertDown(fr1));
context2.restore();
context2.save();
newPainter(flipVertDown(flipHorizLeft(fr1)));
}
}
我覺得問題出在這裏:img.src = context2.canvas2.toDataURL();如何將畫布圖像轉換爲函數?
正在調用的方法已經過測試並獨立於此特定的代碼塊工作。
關於使用的語言的任何信息將是非常有用的... java? – DarkSquirrel42
一切都是javaScript – mcgraw
http://stackoverflow.com/questions/934012/get-image-data-in-javascript –