BitmapDataこまぎれちゃん
BitmapDataこまぎれちゃん
public static function BitmapSlicer(target:DisplayObject, width:Number, height:Number):Array {var sourceBmpData:BitmapData = new BitmapData(width, height, true, 0x000000);sourceBmpData.draw(target);var sliceArr:Array = new Array();for (var i:uint = 0; i < height - 1; i++) {var SliceBMP:BitmapData = new BitmapData(width, 1, true, 0x000000);SliceBMP.copyPixels(sourceBmpData, new Rectangle(0, i, width, 1),new Point(0,0));sliceArr.push(SliceBMP);}sourceBmpData.dispose();return sliceArr;}