• <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;

        时间:2023-06-20

                <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;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:使用 JavaScript 和 Canvas 实现 ColorPicker 下一篇:将 HTML5 Canvas 转换为要上传的文件?

                  相关文章

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

                      <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>
                    1. <small id='q8rvl'></small><noframes id='q8rvl'>