Xantomen / GamesInputPal

http://xantomen.com/gamesinputpal/
GNU General Public License v3.0
2 stars 0 forks source link

Feature Request: Explore being able to export the image as a .png with a transparent background #1

Open Xantomen opened 8 years ago

Xantomen commented 8 years ago

I just checked, you can use ctx.drawImage(img, 0, 0); to draw an svg into a html5 canvas element - this oculd be useful if you want to create exportable png images (http://jsfiddle.net/Na6X5/ + http://stackoverflow.com/questions/11112321/how-to-save-canvas-as-png-image) -Stefan

Xantomen commented 8 years ago

Done, with possible improvements!

Using html2canvas library.

Lines dissapeared after rendering, so had to add code to the htmlcanvas event to remove and readd the pertinent class to the Lines. Also controlling in prepareContainerToPrint that things like sort-handles don't show in the print version.

In other cases, might need this fix: https://github.com/cloakedninjas/html2canvas/commit/0bfd4a4e1fc92f15ec96a77e38de28729d9548e9