PDA

View Full Version : Image load dimension cap?



ZakMcCracken
September 9th, 2009, 03:22 PM
I've run into a problem where a significantly large image will not load.

I put a ProgressEvent listener on the loader and it shows that the file load completes, but the COMPLETE event never fires.

This particular image is a png at 6940 x 4568. At first I assumed it was the file size but I tried a 5k with the same dimensions and this had the same problem.

I also read that 2880 is the magic number I should try to stay below, but I tried 2881 x 2881 and it loaded just fine.

Embedding it works fine and everything, but now I'm just curious..

Krilnon
September 9th, 2009, 03:42 PM
In the future you should check out the Flash Limits thread (http://www.kirupa.com/forum/showthread.php?t=16877) first for this sort of question. (it's not that I expected you to know before; but now you do)


BitmapData:
-max total pixels FP10: 16,777,215 (2^24 - 1)
-max dimensions FP9: 2880 x 2880px

Your bitmap is 31,701,920px total, which is too big for FP10's Loader class.

Expanded explanation here: http://www.bit-101.com/blog/?p=1426

ZakMcCracken
September 9th, 2009, 03:56 PM
Thanks Krilnon! Good to know.

My reason for such a large image is that I need relatively high def sprite sheet animation.

I'm not really sure how the Loader loads the bitmapdata for the image, but I wonder if it would be possible (and just as fast) to somehow separate out each image by row into an array, and then clear that row's data from the bitmap as a whole to avoid the pixel cap..