Skip to main content
Inspiring
October 15, 2011
Question

Bitmap/picture/whatever size limitation in Adobe Air on iPhone.

  • October 15, 2011
  • 2 replies
  • 3254 views

Hi

I'm gonna start on a new app and was wondering what the max width and height of a picture can be?

I will import a big picture into my Flash CS5.5 (pro) and place it in a movieclip.

I found this info on an old site from 2008:

Note: The maximum dimensions of a bitmap in Flash Player is limited to 2880 pixels in either direction (width or height). If you attempt to create a BitmapData instance that is larger than this restriction, the Bitmap will not be created. This limit is in place to keep people from creating Flash movies that gobble up the client’s RAM. A bitmap that is 2880 x 2880 pixels, will use roughly 32MB of RAM.

I'm not sure if that is the limit of today's flash version. I'm using Flash CS5.5 Pro.

And íf now, let's say the max width and height of a picture (or should I rather say bitmap?) is 2880x2880, will the limit change in any way if it's placed in a movieclip?

According to some more info on the same site, there's no limit if you do a "trick":

[Workaround] Flash Bitmap maximum width and height

The trick is to “kidnap” a BitmapData object from a loaded image with dimension over the limit of 2880 pixels (Which flash allows. Huh! Yes Flash can actually handle bitmaps larger the the limit. It just doesn’t let you create one.).

It’s simple. Create a dummy image with the dimension you need. Save it and make it accessible to Flash. Dynamically load it using ActionScript. And take the loader object’s BitmapData object. That’s why I termed it “kidnap”. We are actually just taking the child of the parent object(loader object), which is the BitmapData, and use it like we build it ourselves.

Here’s the actionscript ,

// 1. Create an image loader and

var DummyImageLoader:Loader = new Loader;

// 2. Assign a function to “kidnap” the BitmapData object

DummyImageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, DummyImageOnComplete);

// 3. Load the image with the preferred dimension

var DummyImageRequest:URLRequest = new URLRequest(“dummy_image.jpg);

DummyImageLoader.load(DummyImageRequest);

function DummyImageOnComplete(evt:Event):void {

     var DummyImageBitmap = Bitmap(DummyImageLoader.content);

     // “kidnap” the BitmapData object

    var ValidBitmapData:BitmapData = DummyImageBitmap.bitmapData;

    // you can now use ValidBitmapData to draw any element larger than 2880×2880

}

var InvalidBitmapData:BitmapData = new BitmapData(3000, 3000);

Now, I don't think I can do it this way anyway, I need to import it and manually put stuff on the picture in the movieclip in the Flash IDE.

Is there a difference in picture size limit between normal Flash stuff (no Adobe Air) and Adobe Air? Maybe the picture limit also changes if the app is made for an iPhone?, ie, size limit for Adobe Air could be 2880x2880, but the iPhone can only handle max 2000x2000 so I must not do bigger than 2000x2000.

Speaking of picture size limits in Flash, I experienced a problem once in Flash MX. I had a picture of max size imported, I could scroll to the far right, left, up and down in the Flash Player (not IDE, this was with code) and I could see every bit of the picture, so it all worked ok... but for some reason, the graphics I manually placed on the picture (the graphics were tiny objects I've drawn myself placed in movieclips) only showed in a limited area... for instance:   the big picture I imported was 2880x2880, I have the starting position in the bottom right corner of the picture. I place some graphics on the picture far apart from each other.. first one on .x=2880/y=2880 (bottom right), then I placed several from that position to the far left, til I reached x=0/y=2880... for some reason the graphics half way to the left stopped showing. I only placed like 10 small things. So, if the picture size limit is 2880x2880, it can not show anything else beyond a certain point? only the picture itself?

I apologize for my somewhat bad English... I find it hard to express what I want to say

This topic has been closed for replies.

2 replies

Innovatology
Participating Frequently
October 16, 2011

Flash Player 11 and Air 3 are no longer a bottleneck for the size of your bitmaps - they support unlimited bitmap dimensions. Of course you may still be limited by available memory.

Colin Holgate
Inspiring
October 15, 2011

I believe there's a limit of 16 million pixels, but you can go over 2880 in size. So, 8000x2000 would be ok, but 5000x4000 wouldn't.

TenchyMyoAuthor
Inspiring
October 15, 2011

Thanks for the answer and I hope more people can clarify, as "I believe" is not 100% sure

If the 16 millions pixels would be true, then a 4000x4000 picture would suffice.

Colin Holgate
Inspiring
October 15, 2011

Quite often, what "I believe" happens to be the truth!

Check this page for more info that you could ever want:

http://kb2.adobe.com/cps/496/cpsid_49662.html