CanvasScript3
>
Tests
> BitmapData - CopyPixels
Code
var stage = new Stage("canvas", 420, 500, 30); var loader = new Loader(); loader.contentLoaderInfo.addEventListener(Event.COMPLETE, function(e) { var bitmap = loader.content; var bitmapdata = bitmap.bitmapData; var topHalf = new Rectangle(0, 0, 420, 250); var dstPoint = new Point(0, topHalf.height); //copy top half to bottom half bitmapdata.copyPixels(bitmapdata, topHalf, dstPoint); }); loader.load(new URLRequest('img/photo01.jpg')); stage.addChild(loader);
Canvas
Output