Saturday, 17 August 2013

Should I replace all img elements with the canvas element?

Should I replace all img elements with the canvas element?

I'm new to the canvas element of html5. I'm specifically wondering when
you should put an existing img element inside of a canvas element.
What's the benefit or appropriate use of this?
I've been reading http://diveintohtml5.info/canvas.html and didn't quite
get what I was looking for in their concluding statement on the topic of
canvas:
The simple answer is, for the same reason you might want to draw text on a
canvas. The canvas coordinates diagram included text, lines, and shapes;
the text-on-a-canvas was just one part of a larger work. A more complex
diagram could easily use drawImage() to include icons, sprites, or other
graphics.
Thanks!

No comments:

Post a Comment