javascript - Capture HTML Canvas as gif/jpg/png/pdf? -


is possible capture or print what's displayed in html canvas image or pdf?

i'd generate image via canvas, , able generate png image.

oops. original answer specific similar question. has been revised:

var canvas = document.getelementbyid("mycanvas"); var img    = canvas.todataurl("image/png"); 

with value in img can write out new image so:

document.write('<img src="'+img+'"/>'); 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

spring cloud - How to configure SpringCloud Eureka instance to point to https on non standard port -

javascript - Bootstrap Popover: iOS Safari strange behaviour -