Some Notes on recient code.
Notes
- For the fill demo
- ctx.fill()
- This can have two parameters
- A path, which is a collection of moveTo's and lineTo's
- The fill rule (evenodd or nonzero)
- For the pixel demo
- Color can be spefied in a number of ways
- We have been using names
- Calculated color can be given as
rgb or rgba
- reference
- general html colors.
- This is a string that is passed to html for parsing
- The values can be
- integers between 0 and 255 for rgb
- A hex value #ff00ffff
- The old style is
- The new style is
-
rgb(r g b)
-
rgb(r% g% b%)
-
rgb(r g b / a%)
-
rgb(r% g% b% / a%)
- We will be back to colors soon.
- Vector vs Raster Demo
- We will discuss keypresses later.
- These are just "events"
- When a key is pressed in the canvas, a notification is sent to the program via an event handler.
- We will discuss the
ctx.save(), ctx.restore(), ctx.scale(), ctx.translate() very soon.
- Create an off screen imag called RasterImage
- This gets mapped to the Vector canvas image
- Which then gets loaded into the raster image