gpt4 book ai didi

javascript - 使用 javascript 将 iframe contenteditable 中的内容绘制到 html5 Canvas 上

转载 作者:行者123 更新时间:2023-12-02 20:21:18 27 4
gpt4 key购买 nike

有没有办法在 html5 Canvas 上绘制或填充将 contenteditable 设置为 true 的 iframe 内容?

最佳答案

没有。您无法使用 Canvas 将浏览器对 HTML 元素的呈现捕获为图片。

唯一与您所描述的内容接近的是,您可以获取序列化的 SVG 文件,让浏览器将其呈现为 img 元素,然后 use drawImage() to write that image to the canvas .

关于javascript - 使用 javascript 将 iframe contenteditable 中的内容绘制到 html5 Canvas 上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5515627/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com