My struggle with the
Flash Bitmap limitations continues (images bigger than 8191x2048 or 2048x8191 aren’t displayed by the Flash Player) because my previous solution didn’t account for masks and the project I was working on did require masks eventually. The solution that I came up with before was simply cut the big image in little pieces (1000x1000) and melt them together and position and rotate the complete component. Like this image shows, the image is shown here with the tiling and depth positioning:

To mask the image we first came up with the solution to cut the mask the same way as the image and than map it at the same position and handle the scaling and rotation with a matrix. But when we tried to implement the rotation of the mask and the image we got stuck in a lot of math and we couldn’t get it perfect. Also we got sub-pixel problems because of the rotation. Flash has to determine how the rotated pixel is re-rendered and had to choose where to put the pixel info, to illustrate: a pixel rotated 45 degrees infects the surrounding pixels in color and can infect the border of the image. So the re-rendered image can become 1 pixel bigger or smaller.

We came up with a new solution, the image is still cut into pieces with a Matrix which takes care of positioning, scaling and now also rotation. And on the same level we also did the mask. So we came up with a set of straight cut images instead of rotated images and the masking was relative simple now. To assure correct gapless tiling (which is not really an issue because of the straight cut images) the images and masks are tiled equally (image, mask, image, mask etc).
I created a demo application which contains the actual source. It loads a big image and has a strange positioned and rotated image. In the left top corner you see a slider which controls the zooming. When you zoom it you’ll see the cutting lines but at 100% they are gone. The application has no nice loaders and the image is big 6000x4800 and the mask is 1000x1000 with an alpha channel so be patience.
ps. My excuse for the double post on Adobe Feeds.