Created
March 17, 2014 15:41
-
-
Save anonymous/9601617 to your computer and use it in GitHub Desktop.
HTML5: Offscreen Canvas
This file contains 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> | |
<script type="application/javascript"> | |
function main(){ | |
// here we create an OFFSCREEN canvas | |
var offscreenCanvas = document.createElement('canvas'); | |
offscreenCanvas.width = 300px; | |
offscreenCanvas.height = 300px; | |
var context = offscreenCanvas.getContext('2d'); | |
// draw something into the OFFSCREEN context | |
context.fillRect(10,10,290,290); | |
// ... | |
} | |
</script> | |
</head> | |
<body onload='main()'> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment