Skip to content

Instantly share code, notes, and snippets.

@nhunzaker
Created June 11, 2012 15:33
Show Gist options
  • Select an option

  • Save nhunzaker/2910680 to your computer and use it in GitHub Desktop.

Select an option

Save nhunzaker/2910680 to your computer and use it in GitHub Desktop.
var preCanvas = document.createElement("canvas"),
preContext = preCanvas.getContext("2d");
preContext.fillRect(0,0,150,150);
preContext.save()
var canvas = document.getElementById("otherCanvas"),
context = canvas.getContext('2d')
context.drawImage(preCanvas, 0, 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment