Join Joe Marini for an in-depth discussion in this video The canvas drawing context, part of Learning HTML Canvas.
- [Instructor] To actually draw things onto a canvas…we need to use the canvas' drawing API…and to do that, we need get a reference to something called…The Canvas Drawing Context.…In this course we're just going to be using…two-dimensional drawing.…So we'll be using the 2D context.…There are other types of contexts that you can request.…For example there's a context for 3D drawing…using an API called WebGL,…but that's a fairly advanced topic…that could easily fill its own course,…so we're just going to focus on 2D.…Assuming we have a reference to a canvas element,…we get the drawing context from it using…the getContext method.…
And you can see here that the function is being called…with the 2d string to indicate that we want to use…the 2D drawing APIs.…That function will return an object that implements…the CanvasRenderingContext2D interface,…which you can learn more about here…in the MDN documentation.…And you can see it's pretty comprehensive,…there's a lot of methods and properties in here…and we'll investigate a lot of these in the course.…
- Canvas examples
- Drawing shapes, arcs, paths, and curves
- Drawing text
- Drawing shadows, patterns, and gradients
- Using clipping paths
- Displaying images and video
- Transforming objects with scaling and rotation
- Manipulating raw pixels
- Applying transitions
- Creating animations
Skill Level Intermediate
1. Overview of Canvas
2. Basic Canvas Drawing Techniques
3. Complex Canvas Drawing
4. Advanced Drawing APIs
5. Practical Examples
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.