Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private function __doProcessBitmaps(bitmapData:BitmapData, backgroundColor:uint):void
- {
- var maxFramesX:int = (bitmapData.width / __mBlockWidth);
- var maxFramesY:int = (bitmapData.width / __mBlockWidth);
- var bitmapDataBuffer:BitmapData = new BitmapData(__mBlockWidth, __mBlockHeight);
- var pointBuffer:Point = new Point;
- var rectangleBuffer:Rectangle = new Rectangle(0, 0, __mBlockWidth, __mBlockHeight);
- for (var i:int = 0; i < maxFramesY; i++)
- {
- __mBitmaps.push(new Array);
- for (var j:int = 0; j < maxFramesX; j++)
- {
- rectangleBuffer.x = (__mBlockWidth * j) + (j > 0 ? j : 0);
- bitmapDataBuffer.copyPixels(bitmapData, rectangleBuffer, pointBuffer);
- var rect:Rectangle = bitmapDataBuffer.getColorBoundsRect(backgroundColor, backgroundColor, false);
- if (rect.width && rect.height)
- {
- var data:BitmapData = new BitmapData(rect.width, rect.height);
- data.copyPixels(bitmapDataBuffer, rect, pointBuffer);
- data.threshold(data, data.rect, pointBuffer, "==", backgroundColor);
- __mBitmaps[i].push(data);
- }
- else
- {
- break;
- }
- }
- rectangleBuffer.y += (__mBlockHeight + 1);
- }
- }
Add Comment
Please, Sign In to add comment