Hi folks,

Apologies if this is the wrong place to be posting this kind of thing, Ive
also posted on StackOverflow but thought I'd post here as I know there are
some Flex experts in this forum and haven't had huge feedback on
StackOverflow on Flex/AIR issues in the past.

AS3 FLEX MOBILE APP CRASHING WHEN SCALING IMAGE

*Problem:*

Zooming in on image by scaling and moving using matrix causes the app to
run out of memory and crash.

*Additional Libraries used:*

Gestouch - https://github.com/fljot/Gestouch

*Description:*

In my Flex Mobile app I have an Image inside a Group with pan/zoom enabled
using the Gestouch library. The zoom works to an extent but causes the app
to die (not freeze, just exit) with no error message after a certain zoom
level.

This would be managable except I can’t figure out how to implement a
threshold to stop the zoom at, as it crashes at a different zoom level
almost every time. I also use dynamic images so the source of the image
could be any size or resolution.

They are usually JPEGS ranging from about 800x600 - 9000x6000.

As of the AS3 docs there is no longer a limit to the size of the BitmapData
object so that shouldn't be the issue.

“Starting with AIR 3 and Flash player 11, the size limits for a BitmapData
object have been removed. The maximum size of a bitmap is now dependent on
the operating system.”

The crash mainly happens on iPad Mini and older Android devices.


*Things I have tried already tried:*

Using Adobe Scout to pin point when the memory leak occurs.

Debugging to find the exact height and width of the marker layer and image
at the time of crash.

Setting a max zoom variable based on the size of the image.

Cropping the image on zoom to only show the visible area. ( crashes on
copyPixels  function and BitmapData.draw() function )

Using imagemagick to make lower quality images ( small images still crash )

Using imagemagick to make  very low res image and make a grid of smaller
images . Displaying in the mobile app using a List and Tile layout.


Any suggestions would be appreciated.


Thanks,


Paul

-- 






*DISCLAIMER: This electronic message together with any attachments is
confidential. If you are not the intended recipient, do not copy, disclose
or use the contents in any way. Please also advise us by return e-mail that
you have received the message and then please destroy. Zutec  Ltd is not
responsible for any changes made to this message and / or any attachments
after sending by Zutec. We use virus scanning software but exclude all
liability for viruses or anything similar in this email or any attachment.*

Reply via email to