Skip to content

Instantly share code, notes, and snippets.

@timohausmann
Created March 6, 2013 08:54
Show Gist options
  • Save timohausmann/5097741 to your computer and use it in GitHub Desktop.
Save timohausmann/5097741 to your computer and use it in GitHub Desktop.
Javascript: Render To Canvas Buffer
var renderToCanvas = function (width, height, renderFunction) {
var buffer = document.createElement('canvas');
buffer.width = width;
buffer.height = height;
renderFunction(buffer.getContext('2d'));
return buffer;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment