Delete canvas rectangle

This commit is contained in:
Karan
2021-12-03 14:51:09 +05:30
committed by GitHub
parent f68e9d9d47
commit 029660dc2b
-27
View File
@@ -1,27 +0,0 @@
<!doctype html>
<html>
<head>
<title>Canvas HTML5</title>
<style>
#canvas {
border: 1px solid black;
}
</style>
</head>
<body>
<canvas id="canvas" width="640" height="640">Not Supported</canvas>
<script>
const canvas = document.querySelector('#canvas');
const ctx = canvas.getContext('2d');
ctx.fillStyle = "red";
ctx.fillRect(100, 100, 500, 300); //filled shape
ctx.strokeRect(90, 90, 520, 320); // outline
ctx.clearRect(150, 150, 400, 200); //transparent
</script>
</body>
</html>