Merged changes

This commit is contained in:
jdescottes
2014-07-03 23:40:30 +02:00
13 changed files with 206 additions and 43 deletions

View File

@@ -48,6 +48,16 @@
}
},
clone : function (canvas) {
var clone = pskl.CanvasUtils.createCanvas(canvas.width, canvas.height);
//apply the old canvas to the new one
clone.getContext('2d').drawImage(canvas, 0, 0);
//return the new canvas
return clone;
},
getImageDataFromCanvas : function (canvas) {
var sourceContext = canvas.getContext('2d');
return sourceContext.getImageData(0, 0, canvas.width, canvas.height).data;