Skip to main content
July 17, 2012
Question

Is it bug for adobe air on ios??

  • July 17, 2012
  • 10 replies
  • 1801 views

I am checking for the Loader class on the ios platform.Surprisingly I am never able to load any transparent png as tranparent, a white background is always added to that when i load image from the CameraRoll using loadFilePromise() method of loader.

It seems that there is some big difference between loadFilePromise() and load() method of the Loader for the transparancy.

As per my code loadFilePromise() is adding additional background color i.e. white on the transparent images,While the things work perfectly for the load() method if we are passing any url of transparent image inside this.

I have set the opaqueBackground = null in both cases.

If any body have any idea please confirm this.

Thanks in Advance,

Shardul

This topic has been closed for replies.

10 replies

August 23, 2012

Finally the things gets fixed!!

Thanks Adobe!!

Pahup
Adobe Employee
Adobe Employee
August 23, 2012

Glad to hear, thanks for letting us know.

-Pahup

July 19, 2012

Hi shardul ,

Thanks for reporting the issue . We have been able to reproduce the issue and are investigating the same

July 31, 2012

Hi all,

I have reported this as bug,

https://bugbase.adobe.com/index.cfm?event=bug&id=3292398

If anyone have any workaround will appriciated.

One major concern is that the same code works perfectly for the android too.

August 1, 2012

Hi Shardul ,

The issue has been fixed . Please wait for the next release . Thanks again for reporting the issue .

Pahup
Adobe Employee
Adobe Employee
July 17, 2012

Hi Shardul,

Could you please share a sample code that demonstrates the problem.

-Thanks

Pahup

July 17, 2012

Below code will always show me a transparent png with white background:-

private var cameraRoll:CameraRoll = new CameraRoll();

            protected function browseForImage(event:MouseEvent):void

            {

                if( CameraRoll.supportsBrowseForImage )

                {

                    cameraRoll.addEventListener( MediaEvent.SELECT, onImageSelect );

                    cameraRoll.browseForImage();

                }

            }

            private var imageLoader : Loader;

            private function onImageSelect( event:MediaEvent ):void

            {

                var imagePromise:MediaPromise = event.data;

                imageLoader = new Loader();

                imageLoader.opaqueBackground = null;

                if( imagePromise.isAsync )

                {

                    imageLoader.contentLoaderInfo.addEventListener( Event.COMPLETE, imageLoaded );

                    imageLoader.loadFilePromise( imagePromise );

                }

            }

            private function imageLoaded( event:Event ):void

            {

                var myLoaderInfo:LoaderInfo = event.target as LoaderInfo;

                var tempBitmapData : BitmapData = new BitmapData(myLoaderInfo.width, myLoaderInfo.height,true,0x00000000);

                tempBitmapData.draw(myLoaderInfo.loader);

                myImage.source = new Bitmap(tempBitmapData);

            }

---------------------------------------------------------------------------------------------------------------------------------------------------------------------

While the code below always shows me the transparent png:-

private var imageLoader : Loader;

            protected function button1_clickHandler(event:MouseEvent):void

            {

                imageLoader = new Loader();

                imageLoader.opaqueBackground = null;

                imageLoader.contentLoaderInfo.addEventListener( Event.COMPLETE,onImageLoaded);

                imageLoader.load(new URLRequest("Any Tranparent Image url here"));

            }

            private function onImageLoaded( event:Event ):void

            {

                var myLoaderInfo:LoaderInfo = event.target as LoaderInfo;

                var tempBitmapData : BitmapData = new BitmapData(myLoaderInfo.width, myLoaderInfo.height,true,0x00000000);

                tempBitmapData.draw(myLoaderInfo.loader);

                myImage.source = new Bitmap(tempBitmapData);

            }

myImage is a bitmap image in both the cases.

Shardul

Known Participant
July 17, 2012

Hello Shardul,

I have exactly the same problem than you since this morning.

Is there anyone knows a solution to keep the transparence of an image when she come from the camera roll ?

Thanks

Loïc