Skip to content

Instantly share code, notes, and snippets.

@alanhoff
Created January 30, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alanhoff/da9ea95c5eb02794663d to your computer and use it in GitHub Desktop.
Save alanhoff/da9ea95c5eb02794663d to your computer and use it in GitHub Desktop.
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
var image = new Image();
image.src = 'data:image/jpg;base64,seu_buffer_transformado_em_base64';
image.onload = function() {
ctx.drawImage(image, 0, 0);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment