I know we can load an image in a canvas but I wonder whether we can convert a simple HTML file to the canvas Are able to load in. If yes, then how?
Thank you.
Short answer: No, you can not.
Long answer: is not trustworthy, but yes you can definitely (possibly laugh) the way. The key you define as "image" you know that you can add an image to the canvas with drawImage () - do not you know what it can be "image" (Not necessarily a real image)
First of all, "image" can be an HTML5 video element - so that you can add a video to the canvas. Secondly, most "modern" browsers may have a SVG document, in which SVG & lt; Foreign objects & gt; The element can be HTML via element.
Browser Support:
- In the
drawImage ()SVG documents are not currently supported in Firefox. And I think a decision has been made. -
& lt; Foreign objects & gt;Most browsers have a buggy - seems to be the best support for Firefox (Ironically).
Example:
& lt; Svg xmlns = "http://www.w3.org/2000/svg" & gt; & Lt; External object x = "0" y = "0" height = "800" width = "800" & gt; & Lt; Body xmlns = "http://www.w3.org/1999/xhtml" & gt; & Lt; P & gt; Hello World! & Lt; / P & gt; & Lt; Input type = "date" /> & Lt; / Body & gt; & Lt; / ForeignObject & gt; & Lt; / Svg & gt; Try to load that file with the canvas drawImage () in Opera - as you will see that its interaction is quite small, but it just shows up is .
Comments
Post a Comment