效果
image.png代码
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<canvas id="canvas" width="600" height="600" style="border: 1px solid #ff0000;"></canvas>
<script>
let canvas = document.getElementById('canvas');
let ctx = canvas.getContext('2d');
ctx.fillStyle = 'rgba(0,0,255,1.0)';
ctx.fillRect(100, 100, 200, 100);
</script>
</body>
</html>
网友评论