It would be incredibly useful to be able to temporarily convert a regular element into a canvas
. For example, say I have a styled div
that I want to flip. I want to dynamically create a canvas, "render" the HTMLElement
into the canvas, hide the original element and animate the canvas.
Can it be done?
There is a library that try to do what you say.
See this examples and get the code
http://hertzen.com/experiments/jsfeedback/
http://html2canvas.hertzen.com/
Reads the DOM, from the html and render it to a canvas, fail on some, but in general works.