📜  如何在背景 html 代码示例上设置画布

📅  最后修改于: 2022-03-11 14:53:27.634000             🧑  作者: Mango

代码示例1
document.body.style.background = "url(" + canvas.toDataURL() + ")";
To actually set this as the background, you can take advantage of the canvas element's toDataURL method which will create an image from your canvas, which you can set as the src of an image or a background