📜  canvas 标签 html - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:18.137000             🧑  作者: Mango

代码示例1
//HTML


//Javascript
var canvas = document.getElementById("canv");
canvas.width = canvas.height = 100;
var ctx = canvas.getContext("2d");
ctx.fillStyle = "red";
ctx.fillRect(10, 10, 80, 80);