LOADING

canvas

2024/10/25
const canvas = document.getElementById("myCanvas");
const ctx = canvas.getContext("2d");

// 绘制红色矩形
ctx.fillStyle = "red";
ctx.fillRect(20, 20, 150, 100);

// 绘制蓝色圆形
ctx.beginPath();
ctx.arc(100, 150, 30, 0, 2 * Math.PI);
ctx.fillStyle = "blue";
ctx.fill();