• <bdo id='nmr9H'></bdo><ul id='nmr9H'></ul>

    1. <i id='nmr9H'><tr id='nmr9H'><dt id='nmr9H'><q id='nmr9H'><span id='nmr9H'><b id='nmr9H'><form id='nmr9H'><ins id='nmr9H'></ins><ul id='nmr9H'></ul><sub id='nmr9H'></sub></form><legend id='nmr9H'></legend><bdo id='nmr9H'><pre id='nmr9H'><center id='nmr9H'></center></pre></bdo></b><th id='nmr9H'></th></span></q></dt></tr></i><div id='nmr9H'><tfoot id='nmr9H'></tfoot><dl id='nmr9H'><fieldset id='nmr9H'></fieldset></dl></div>

        <tfoot id='nmr9H'></tfoot>
      1. <legend id='nmr9H'><style id='nmr9H'><dir id='nmr9H'><q id='nmr9H'></q></dir></style></legend>
      2. <small id='nmr9H'></small><noframes id='nmr9H'>

        将 HTML 元素渲染到 &lt;canvas&gt;

        Rendering HTML elements to lt;canvasgt;(将 HTML 元素渲染到 lt;canvasgt;)

                <tbody id='JwiCz'></tbody>
              <i id='JwiCz'><tr id='JwiCz'><dt id='JwiCz'><q id='JwiCz'><span id='JwiCz'><b id='JwiCz'><form id='JwiCz'><ins id='JwiCz'></ins><ul id='JwiCz'></ul><sub id='JwiCz'></sub></form><legend id='JwiCz'></legend><bdo id='JwiCz'><pre id='JwiCz'><center id='JwiCz'></center></pre></bdo></b><th id='JwiCz'></th></span></q></dt></tr></i><div id='JwiCz'><tfoot id='JwiCz'></tfoot><dl id='JwiCz'><fieldset id='JwiCz'></fieldset></dl></div>

                <legend id='JwiCz'><style id='JwiCz'><dir id='JwiCz'><q id='JwiCz'></q></dir></style></legend><tfoot id='JwiCz'></tfoot>
                  <bdo id='JwiCz'></bdo><ul id='JwiCz'></ul>

                  <small id='JwiCz'></small><noframes id='JwiCz'>

                  本文介绍了将 HTML 元素渲染到 &lt;canvas&gt;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  有没有办法在画布中呈现任意 HTML 元素(然后访问其缓冲区...).

                  Is there a way to have an arbitrary HTML element rendered in a canvas (and then access its buffer...).

                  推荐答案

                  目前你不会得到真正的 HTML 渲染到 <canvas> 本身,因为 canvas 上下文没有渲染函数HTML 元素.

                  You won't get real HTML rendering to <canvas> per se currently, because canvas context does not have functions to render HTML elements.

                  有一些模拟:

                  html2canvas 项目 http://html2canvas.hertzen.com/index.html(基本上是基于 HTML 渲染器的尝试Javascript + 画布)

                  html2canvas project http://html2canvas.hertzen.com/index.html (basically a HTML renderer attempt built on Javascript + canvas)

                  HTML 到 SVG 到 <canvas> 可能取决于您的用例:

                  HTML to SVG to <canvas> might be possible depending on your use case:

                  https://github.com/miohtama/Krusovice/blob/master/src/tools/html2svg2canvas.js

                  另外,如果您使用的是 Firefox 你可以破解一些扩展的权限,然后将 DOM 窗口渲染到 <canvas>

                  Also if you are using Firefox you can hack some extended permissions and then render a DOM window to <canvas>

                  https://developer.mozilla.org/en-US/docs/HTML/Canvas/Drawing_Graphics_with_Canvas?redirectlocale=en-US&redirectslug=Drawing_Graphics_with_Canvas#Rendering_Web_Content_Into_A_Canvas

                  这篇关于将 HTML 元素渲染到 &lt;canvas&gt;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How does object-fit work with canvas element?(对象适合如何与画布元素一起使用?)
                  How to make rooftext effect and valley text effect in HTML5 (or Fabric.js)(如何在 HTML5(或 Fabric.js)中制作屋顶文字效果和山谷文字效果)
                  Draw border around nontransparent part of image on canvas(在画布上的图像不透明部分周围绘制边框)
                  dragging and resizing an image on html5 canvas(在 html5 画布上拖动图像并调整其大小)
                  What#39;s the difference between a boolean as primitive and a boolean as property of an object?(作为原始对象的布尔值和作为对象属性的布尔值有什么区别?)
                  I want to do animation of an object along a particular path(我想沿特定路径对对象进行动画处理)

                    <tfoot id='q8rvl'></tfoot>

                          <tbody id='q8rvl'></tbody>
                        <legend id='q8rvl'><style id='q8rvl'><dir id='q8rvl'><q id='q8rvl'></q></dir></style></legend>
                        <i id='q8rvl'><tr id='q8rvl'><dt id='q8rvl'><q id='q8rvl'><span id='q8rvl'><b id='q8rvl'><form id='q8rvl'><ins id='q8rvl'></ins><ul id='q8rvl'></ul><sub id='q8rvl'></sub></form><legend id='q8rvl'></legend><bdo id='q8rvl'><pre id='q8rvl'><center id='q8rvl'></center></pre></bdo></b><th id='q8rvl'></th></span></q></dt></tr></i><div id='q8rvl'><tfoot id='q8rvl'></tfoot><dl id='q8rvl'><fieldset id='q8rvl'></fieldset></dl></div>
                        • <bdo id='q8rvl'></bdo><ul id='q8rvl'></ul>
                          • <small id='q8rvl'></small><noframes id='q8rvl'>