You must divide the image into tiles with a range of magnification. Calculate and build these off-line and send them as separate files in the application bundle. Given the magnification of your display, select the closest zoom. Then you select which tiles are needed to cover the screen, and create a grid of them. When the user zooms in, select the appropriate tile size.
The advantage of this is that you never have to load HUGE files in memory, only as much as necessary.
This is what Google maps do.
I can not give you any code, sorry!
source share