Lecture 1: Getting Started with the Canvas

1.1 Introduction to HTML Canvas

1.2 Basic Drawing Shapes

1.3 Exercise

  1. Create an HTML page with a canvas of size 400×300.
  2. Draw three filled rectangles with different colors and coordinates.
  3. Draw a rectangular outline (using strokeRect) of a different color.
  4. Use clearRect to erase a small area from one of the rectangles.

This will help you get comfortable with the basics of the canvas context and coordinate system.


Lecture 2: Paths, Shapes, and Text

2.1 Paths and Shapes