Answers for "how to add bg image on canvas in html js"

1

how to set canvas on background html

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
Posted by: Guest on December-29-2021

Browse Popular Code Answers by Language