(CODE FOR HTML;)
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Exercise 10 Drawing In Canvas </title>
</head>
<body>
<canvas id="myCanvas" width="1345.5" height="603.5"
style="border:1px solid #000000;">
</canvas>
<script>
var canvas = document.getElementById("myCanvas");
var ctx = canvas.getContext("2d");
ctx.globalAlpha = 0.8
ctx.fillStyle = "#cbc6dc";
ctx.fillRect(500,110,283,353);
ctx.fillStyle = "#e8b1a9";
ctx.fillRect(520,128,230,300);
ctx.fillStyle = "#00aeff";
ctx.beginPath();
ctx.fillStyle = "#e0defa";
ctx.fillRect(520,403,245,50);
ctx.fillStyle = "#aba4a4";
ctx.fillRect(520,403,245,10);
</script>
</body>
</html>
Comments
Post a Comment