Images and drawImage()
Explore how to display images on an HTML5 canvas by accessing image sources and using the drawImage method. Learn to position and scale images effectively, gaining a fundamental understanding necessary for creating graphics and animations.
We'll cover the following...
We'll cover the following...
Getting an image to display into your canvas follows a very simple formula made up of these two steps:
- Gain access to an image source (aka an image file, another canvas element, a frame from a video element, etc.)
- Display the data from the image