Lan_
2016-04-20 20:11
window.onload = function(){
var canvas = document.getElementById("canvas");
canvas.width = 800;
canvas.height = 800;
var context=canvas.getContext("2d");
var LinearGrad=context.createLinearGradient(0,0,800,800);
LinearGrad.addColorStop(0.0,'#fff');
LinearGrad.addColorStop(1.0,'#000');
context.fillStyle=LinearGrad;
context.fillRect(0,0,400,400);
}
好吧,我知道为什么了。。。。
Canvas绘图详解
72881 学习 · 422 问题
相似问题