views:

514

answers:

4

We have discovered that when we draw one bitmapdata into another bitmapdata using draw, there is an upper bound on the scaling transform. At some point the IBitmapDrawable parameter ceases to be rendered on the target bitmap.

Does anyone know what the parameters of this upper bound are? Is this documented somewhere?

+1  A: 

The docs say:

The maximum width and maximum height of a BitmapData object is 2880 pixels.

I'd guess it's that limit you're hitting.

grapefrukt
+1  A: 

note: in flash 10 that limit has been removed

pigiuz
+1  A: 

Actually this subject is quite tricky... there are a few documented limitations, but many different undocumented limitations in different scenarios and Flash Player versions... for instance, check this post and its comments: http://www.bit-101.com/blog/?p=2067

And if you allow me to quote myself ^^

I’ve had the same problem and I think that it’s not really a draw() limitation, but a DisplayObject one… for instance:

var bmp=new BitmapData(8000,100,false,0);
var bmp2=new BitmapData(8000,10,false,0xFF0000);
bmp.draw(bmp2);

works perfectly… same with other methods like fillRect and applyFilter. However, it fails if you try to draw() any DisplayObject beyond 4079 pixels in horizontal, or 4082 in vertical (according to getColorBoundsRect).

Also, there are a few threads with similar questions here in SO: http://stackoverflow.com/questions/1019360/maximum-size-of-a-sprite-in-as3

Cay
+1  A: 

While the BitmapData has upper bounds to its size when constructed (2880x2880 in f9, 16,775,168 total pixel area in f10), we found that a slightly different constraint applies when transforming a bitmapData and drawing only a section of it.

If your bitmapData is 1x1px in size, you can scale it to a maximum of 8191x8191px (much bigger than a BitmapData you can construct in f10) and draw the bitmap into another bitmap. If you scale your bitmap larger than that, it just won't show up.

jedierikb