0
我使用這種方式..多個實例:JavaScript的
var canvas = document.getElementById("canvas");
var contextGrayLine= canvas.getContext("2d");
var contextRedLine= canvas.getContext("2d");
contextGrayLine.lineWidth = 50;
contextRedLine.lineWidth = 20;
contextGrayLine.beginPath();
contextGrayLine.moveTo(10,10);
contextGrayLine.lineTo(500,10)
contextGrayLine.strokeStyle = "#AAA";
contextGrayLine.stroke();
我創建了帆布的兩個實例,但redLine.lineWidth在寫grayLine.lineWidth值......爲什麼會這樣???
任何良好的資源來學習帆布的細節..和任何良好的lib用於開發畫布代碼..就像上面的一個。 – goutham 2010-09-11 10:54:19
https://developer.mozilla.org/zh/Canvas_tutorial – DevAno1 2011-05-17 12:32:58