Created
May 13, 2015 13:19
-
-
Save klaemo/61ff0bc2fd3b81490be6 to your computer and use it in GitHub Desktop.
fast image rendering in the browser
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
var context = canvas.getContext('2d') | |
var img = new Image() | |
img.onload = function() { | |
context.drawImage(img, 0, 0) | |
window.URL.revokeObjectURL(this.src) | |
} | |
img.src = window.URL.createObjectURL(new Blob([data], {'type': 'image\/jpeg'})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment