Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function saveCanvas(canvas) {
- var image = canvas.toDataURL("image/png",1)//.replace("image/png", "image/octet-stream");
- // window.open(null, '_blank')
- window.setTimeout(()=>{
- var win = window.open();
- win.document.write('<img src="' + image + '" style="-webkit-user-select: none;background-position: 0px 0px, 10px 10px;background-size: 20px 20px;background-image:linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%, #eee 100%),linear-gradient(45deg, #eee 25%, white 25%, white 75%, #eee 75%, #eee 100%);"/>')
- win.document.body.style.backgroundColor = 'black';
- win.document.body.style.margin = 0;
- win.document.body.style.display = 'flex';
- win.document.body.style.alignItems = 'center';
- win.document.body.style.justifyContent = 'center';
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement