Skip to main content
July 8, 2011
Question

image loaded successfully, but fail to draw bitmap of it

  • July 8, 2011
  • 1 reply
  • 990 views

I  have a image loaded from  different domain. The checkpolicy is set to  true and crossdomain file  has no problem.  The image isn't that large,  2,304px × 1,260px

In the application, I will draw the bitmap image with this call

new Bitmap(Bitmap(imgLoader.content).bitmapData, "auto", true);

The   weird part is, there is 1% chance... the application can't draw the   bitmap... it will just be empty. It never happens to me, but some of my   users are complaining they can't see any image. I think they have  pretty  decent computer, and see the application on ie8 or ff4

Not   sure is there anything I am doing wrong... I am sure the image is   loaded to user's browser, but the application just can't draw it....

Can anyone help?

Thanks a lot

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
July 8, 2011

you have a cross-domain security problem.  you need to add a cross-domain security file to the image host.

July 8, 2011

the cross domian policy is checked before...

as I said, in most of time.. it works... only failed several times...

kglad
Community Expert
Community Expert
July 8, 2011

1.  are you using the bitmapdata draw() method somewhere in your code?

2.  why are you using

new Bitmap(Bitmap(imgLoader.content).bitmapData, "auto", true);

to create a bitmap?  are you making several copies of your loaded image?