Skip to content

Instantly share code, notes, and snippets.

@gerred
Created September 13, 2012 17:32
Show Gist options
  • Save gerred/3716047 to your computer and use it in GitHub Desktop.
Save gerred/3716047 to your computer and use it in GitHub Desktop.
var canvas = document.createElement("canvas")
var context = canvas.getContext("2d")
canvas.width = window.innerWidth
canvas.height = window.innerHeight
context.drawWindow(window, 0, 0, window.innerWidth, window.innerHeight, "rgb(255,255,255)")
var image = canvas.toDataURL('image/jpeg', 0.2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment