For readibility, I posted the code examples that my solutions refer to first, and thenI listed the explanations of my solutions in a numerical list.
I have been
The right approach is to decode for the size you need to show and subsample the image in tiles when you need to zoom.
There's a library that should do exactly this, check it out: https://github.com/davemorrissey/subsampling-scale-image-view