1
votes

According to docs

Starting with AIR 3 and Flash player 11, the size limits for a BitmapData object have been removed. The maximum size of a bitmap is now dependent on the operating system.

I am following up on question to this answer.

It would be nice to get the largest bitmap that OS would permit.

Can I check the RAM available and pick bitmap size accordingly? Or do I need to pick a size like 4096x4096 and stick to it?

update: trying the following: new BitmapData(4096, 4096, transp, 0x00FFFFFF); Gives me error - Error #2015: Invalid BitmapData. It looks like I'm hitting Flash Player 10 ceiling of 16,777,215 pixels even though I'm compiling and running 11.

1

1 Answers

0
votes

You could make a while( true ) where you create new BitmapDatas of the shape new BitmapData( 1, x );

You see, the limit is actually the bitmapdata's width * height, so just increase x ! Don't start from 1, start from 16 million or something. Afterwards you have your width * height limit, which most likely is Y squared. Just do a Math.sqrt( x ) and you will have your limit, assuming you are interested in squares. Otherwise determine a width and your max height will be x / width, rounded down.