Skip navigation
vhk009
Currently Being Moderated

Not able to load huge Image 480px * 9720px

Jun 24, 2013 7:48 AM

Tags: #player10 #flex-3.2

Hi ALL,

 

Facing issue when trying to load image of 480px * 9720px, is there any limit for width and height to image.

I am using sdk3.2 and flash player10.

 

I tried in below mentioned ways:

 

1)Using <mx:image source="http://localhost:8081/testimg/photo01.png">

     -not able to see image after application load complete.

2)Using Loader class

     -not able to dispatch Event.COMPLETE even after total bytes loaded.

 

  code:

  var bitmapPath:String = "http://localhost:8081/testimg/photo01.png";

                                        var myBitmap:Bitmap;

                                        var bitmapLoader:Loader;

 

 

                                        bitmapLoader = new Loader();

                                        bitmapLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, addBitmap);

                                        bitmapLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR ,loadingError);

                                        bitmapLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRES S,updateInfo);

  bitmapLoader.load(new URLRequest(bitmapPath));

 

 

  function addBitmap(event:Event):void

                                        {

                                                  var bd:BitmapData = new BitmapData(event.currentTarget.content.width, event.currentTarget.content.height);

                                                  bd.draw(event.currentTarget.content);

 

                                                  myBitmap = new Bitmap(bd);

 

                                                  var img:Image = new Image();

                                                  img.addChild(myBitmap);

                                                  imgContainer.addChild(img);

                                        }

 

                                        function updateInfo(e:ProgressEvent):void {

                                                  trace("Loading: "+String(Math.floor(e.bytesLoaded/1024))+" KB of "+String(Math.floor(e.bytesTotal/1024))+" KB.");

                                        }

 

                                        function loadingError(e:IOErrorEvent):void {

                                                  trace("There has been an error loading the image. The server may be busy. Refresh the page and try again.");

                                        }

 

Thanks a lot in advance,

Hari krishna.

 
Replies
  • Currently Being Moderated
    Jun 24, 2013 8:14 AM   in reply to vhk009

    Flash player 10 has a BitmapData size limit.

     

    http://helpx.adobe.com/flash-player/kb/size-limits-swf-bitmap-files.ht ml

     

    "Flash Player 10 increased the maximum size of a bitmap to a maximum pixel count of 16,777,215 (the decimal equivalent of 0xFFFFFF).  There is also a single-side limit of 8,191 pixels. These restrictions mean that either the width or the height can be 8,191 pixels as long as the total pixel count isn't exceeded."

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points