html2canvas Uncaught (in promise) undefined

前端 未结 2 686
春和景丽
春和景丽 2021-01-27 13:07

I have a html tag canvas.


I can draw on it successfully, and it looks really good, as i wanted to

2条回答
  •  半阙折子戏
    2021-01-27 13:36

    Tested Chrome, Firefox ok, IE 11 needs adding 2 extra js library to support promise.

    function takeSnapShot() {
    	html2canvas(document.querySelector("#capture")).then(function(canvas9) {
    		var theimage9 = canvas9.toDataURL("image/png");
    		document.querySelector("#theimage9").src = theimage9; 
    	});
    }
    
     
    
    

    Hello world!

提交回复
热议问题