Jump to content

BitmapData copyrect not working in IE11


charlie_says
 Share

Recommended Posts

Hi,

 

I've had this issue before, finding that BitmapData.copyrect doesn't work on IE for some reason. (It fails silently, basically the game will just stop). Previously, I'd worked around by using BitmapData.draw, but doing that this time will be a bit more involved, and I'm keen to try to understand what's going wrong.

 

But, so far, I've not had much luck tracking down the issue - does anyone have any idea?

 

 

Link to comment
Share on other sites

I investigated this further... I can't figure out what causes the issue, especially as all the bitmapdata methods work in the same way! (they all re-use copy(...) which would seem to mean that it should just work.)

But, copyrect definitely fails in IE if you're trying to copy a rectangle which is differently sized (I was trying to copy a small bmd to a large bmd, this generates an index error.)

I was able to work around it (again) using draw...

Link to comment
Share on other sites

37 minutes ago, charlie_says said:

But, copyrect definitely fails in IE if you're trying to copy a rectangle which is differently sized (I was trying to copy a small bmd to a large bmd, this generates an index error.)

Make sure the source rectangle is fully within the source image.

Link to comment
Share on other sites

Interestingly, what I'm trying to do is copy a small bitmapdata into a larger one, with an offset to centre it. It doesn't appear that anything is outside of the bounds... The only thing I could think is that by using .draw which copies some properties from the source, rather than copyRect to which I only pass a few variables, was missing something.

But, I did try doing the operation using .copy and passing everything I had, and it still didn't work for me (in IE11, works fine everywhere else.)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...