Created
April 23, 2016 13:25
-
-
Save peko/30793c2611834cd15f7efee6e023348e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <script type="text/javascript" src="apng-canvas.min.js"></script> | |
| </head> | |
| <body> | |
| <canvas id="cvs" with="512px" height="512px"> | |
| <script type="text/javascript"> | |
| var cvs = document.getElementById("cvs"); | |
| var ctx = cvs.getContext("2d"); | |
| APNG.parseURL("cube.png") | |
| .then( | |
| function(anim,e){ | |
| console.log(anim,e); | |
| for(var i=0;i<anim.frames.length; i++) { | |
| ctx.drawImage(anim.frames[i].img, i, i) | |
| } | |
| }) | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment