2013-06-30 03:58:30 +01:00
2013-06-30 03:58:30 +01:00
2013-06-30 03:57:07 +01:00

console.snapshot( canvas )

Snapshot a canvas and output it to the console.

console.snapshot takes and inputted <canvas> element and outputs a snapshot of it into the console. It makes debugging the canvas a little less dramatic. See this demo. console.snapshot is a fork of the console.image and actually does something useful.

The demo

Usage

console.snapshot( <canvas> )

console.snapshot takes in a HTMLCanvasElement, base64 encodes it using toDataURL and then outputs it to the canvas using canvas.image.

var canvas = document.createElement("canvas"),
	ctx = canvas.getContext("2d");

	// ...
	//draw
	// ...

console.snapshot(canvas);

console.image( <url> )

console.image outputs and image from a url into the console. See console.image.

console.image("http://i.imgur.com/wWPQK.gif");

License: MIT

Description
An actual useful fork of the console.image. Snapshot the canvas and output it to the console.
Readme 46 KiB
Languages
JavaScript 61%
HTML 39%