Exercise 7: Painting in Canvas

 




(image wont load)


<!DOCTYPE html>

<html>

<head>

<meta name="viewport" content="width=device-width, initial-scale=1">

<title>Exercise 010 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 = "#b94301";

ctx.fillRect(500,110,283,353);

ctx.fillStyle = "#b94301";

ctx.fillRect(520,128,230,300);

ctx.fillStyle = "#ffe79c";

ctx.beginPath();

ctx.arc(580,220,50,0,2*Math.PI);

ctx.fill();


ctx.fillStyle = "#ffe79c";

ctx.beginPath();

ctx.arc(580,180,40,0,2*Math.PI);

ctx.fill();

ctx.fillStyle = "#ffe79c";

ctx.beginPath();

ctx.arc(580,190,40,0,2*Math.PI);

ctx.fill();

ctx.fillStyle = "#ffe79c";

ctx.fillRect(560,128,50,315);

ctx.fillStyle = "#ffe79c";

ctx.fillRect(520,393,245,50);

ctx.fillStyle = "#292828";

ctx.fillRect(520,410,245,10);


ctx.fillStyle = "#ffe79c";

ctx.fillRect(580,128,3,315);

ctx.fillStyle = "#ffe79c";

ctx.fillRect(520,393,245,5);

ctx.fillStyle = "#8300e0";

ctx.fillRect(715,128,5,315);


ctx.fillStyle = "#292828";

ctx.fillRect(520,385,245,3);


ctx.fillStyle = "#8300e0";

ctx.fillRect(725,128,10,315);


</script>

</body>

</html>

Comments

Popular posts from this blog

Animation Transition Activity

Adding A Youtube Link Embed

let's talk about Sketches