I want to implement vertical scrolling of the contents of an HTML5 canvas element. I do not want to display all the content again. Instead, I would like to move all the content up / down and display only the area that was scrolled into the window.
I experimented with the getImageData and putImageData , but in my tests they are almost as slow as repainting the entire scene.
What is the fastest way to copy areas of a rectangular pixel inside a canvas element?
javascript html5 canvas
Fabian jakobs
source share