Workaround for BitmapData.draw of DisplayObject beyond 4096 pixels
Today I was doing a little research on how to do bitmap scrolling. To do such test it’s nice to have a big bitmap. So I’ve created big MC and instantly faced a problem with creating bitmaps from DisplayObjects with height/width higher than 4096.
For example, OK bitmap (oryginal size is 6492):

And that’s how it look after creating bitmap using BitmapData.draw:

As you can see, there’s some weird stuff going on after 4096.
I was testing scrollRect as a solution for scrolling a big and complicated MovieClips.
It sux – works just like rectangle mask (redraw area shows that still whole MC is rendered, and FPS is not any higher that normal moving).
But it turns out a scrollRect can be used to force properly drawing of DisplayObject. Simply by moving stuff with scrollRect every 4096 pixels, drawing this to temporary bitmap, and pasting one by one to target bitmap.
The final solution can be found on BitmapUtils.getBitmapDataByBigDisplay.
Test can be found here.
Related posts:
Leave a Reply.
To write ActionScript code please use [as][/as] tags.
