P 18
P 18
DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8”>
<style>
</style>
</head>
<body>
<script>
// Draw Rectangles
Function drawRectangles() {
Ctx.fillStyle = ‘#FF0000’;
Ctx.strokeStyle = ‘#0000FF’;
Ctx.lineWidth = 5;
// Draw Circles
Function drawCircles() {
Ctx.beginPath();
Ctx.fillStyle = ‘green’;
Ctx.fill();
Ctx.beginPath();
Ctx.strokeStyle = ‘purple’;
Ctx.lineWidth = 5;
Ctx.stroke();
// Draw Text
Function drawText() {
Ctx.font = ‘30px Arial’;
Ctx.fillStyle = ‘black’;
Ctx.strokeStyle = ‘red’;
Ctx.lineWidth = 2;
// Draw Image
Function drawImage() {
Img.onload = function() {
// Clear Canvas
Function clearCanvas() {
</script>
</body>
</html>