BIT-101 [2003-2017]

Big Ass Bitmaps in Flash 10


I remember reading, I think possibly on Tinic’s blog, a while back that BitmapData maximum sizes would be increasing. Then I heard Jim Corbett mention it at FiTC this year, along with some details. I know I could probably find the specs in writing somewhere, but I decided to test it out myself. And then blog it so I’ll know where to find it in the future.

It’s a bit more complex than Flash 8/9 constraints, which is simply a maximum size of 2,880 x 2,880, for a total pixel count of 8,294,400. We get more than twice the number of pixels to play with, but we also get some more freedom in how to use them.

So, the maximum pixel count is now 16,777,215. You might recognize that as the decimal equivalent of 0xFFFFFF. So, if you are looking for a square bitmap, the largest one you can make is 4,095 x 4,095, which results in 16,769,025 pixels. If you try to go to 4,096 x 4,096, you wind up with 16,775,216 pixels and an invalid bitmap FAIL. So not bad, that’s an extra 1,200-something pixels in each dimension.

But it’s actually better than that. Like I said, there’s more flexibility. You can actually go up to 8,191 pixels in either width OR height, as long as the total number of pixels stays under the limit. This means that you can have a bitmap up to 8,191 x 2,048 (or 2,048 x 8,191), which amounts to 16,775,168 pixels.

Now, that’s a bit much to try to visualize, so here’s a graphic to help you along:

This shows the maximum Flash 8/9 bitmap size, along with the maximum square and rectangular sized bitmaps in Flash 10. Cheers! Now get out there and crash some browsers!

« Previous Post
Next Post »