blob: a380c07c286dfc0287cf79f76136d30776e7d3b5 [file] [log] [blame] [view]
davemorrisseyb064b0b2013-08-26 09:45:26 -07001subsampling-scale-image-view
2============================
3
David Morrissey0e895c22013-08-26 20:07:35 +01004A custom ImageView for Android with pinch to zoom and subsampled tiles to support large images. While zooming in, the
5low resolution base layer is overlaid with tiles in the best resolution for the current scale, and tiles are loaded and
6discarded during panning to avoid loading too much image data.
7
8Unfortunately it's difficult to know how much image data it's safe to load but the view appears stable on tested devices.
9
10Supports:
11* Display of images of any size
12* Pinch to zoom
13* Panning while zooming
14* One finger pan with momentum
15* Can be easily extended to add overlays
16* Tiles over 2048px are avoided to support hardware acceleration
17
18Limitations:
19* Requires SDK 10 (Gingerbread).
20* BitmapRegionDecoder does not support decoding an image from resources - the image file needs to be in assets or external storage.
21* Very wide or tall images may still cause out of memory errors because each tile has same w:h ratio as the source image. Fixing this should be fairly easy if required.
22* Does not support changing the image after one is loaded. This is another fairly simple change.