SSIV Test App
Subsampling Scale Image View
View on GitHub
Animate
Next
Previous
Rotate
Reset
Basic features
Basic features
Pinch to zoom
Use a two finger pinch to zoom in and out. The zoom is centred on the pinch gesture, and you can pan at the same time.
Quick scale
Double tap and swipe up or down to zoom in or out. The zoom is centred where you tapped.
Drag
Use one finger to drag the image around.
Fling
If you drag quickly and let go, fling momentum keeps the image moving.
Double tap
Double tap the image to zoom in to that spot. Double tap again to zoom out.
Image display
Image display
Large images
This image is 7,800 x 6,240 pixels. On most devices it will be subsampled, and higher quality tiles are loaded as you zoom in.
Rotation
This image has been rotated 90 degrees. Tap the button to rotate it. EXIF rotation is supported for external files.
Display region
Set the region to display instead of the whole image.
Event handling
Event handling
Simple events
Touch handling by the image view doesn\'t prevent normal events from working.
OnClickListener
This view has an OnClickListener. Tap once to activate the click.
OnLongClickListener
This view has an OnLongClickListener. Press and hold to activate it.
Advanced event handling
Advanced event handling
Overriding gestures
Some gestures can be overridden with your own
GestureDetector without affecting the image view. This allows you to get the coordinates of
the event.
onSingleTapConfirmed
onSingleTapConfirmed has been overridden. Tap the image to
see coordinates.
onDoubleTap
onDoubleTap has been overridden. Tap the image to see
coordinates. This overrides the default zoom in behaviour.
onLongPress
onLongPress has been overridden. Press and hold the image
to see coordinates.
Other events
You can override any event you want, but customising swipe,
fling and zoom gestures will stop the view working normally.
View pager galleries
View pager gallery
Horizontal
This gallery has two images in a ViewPager. Swipe to move to the
next image. If you\'re zoomed in on an image, you need to pan to the right of it, then swipe
again to activate the pager.
Vertical
Vertical view pagers are also supported. Swipe up to move to the
next image. If you\'re zoomed in on an image, you need to pan to the bottom of it, then
swipe again to activate the pager.
Animation
Animation
A demo
Tap the play button. The image will scale and zoom to a random point, shown by a marker.
Limited pan
If the target point is near the edge of the image, it will be moved as near to the center as possible.
Unlimited pan
With unlimited or center-limited pan, the target point can always be animated to the center.
Customisation
Duration and easing are configurable. You can also make animations non-interruptible.
Extension
Extension
Location pin
This view class extends the image view, and adds a pin anchored to a point on the image.
Overlaid circle
A slightly more advanced example, this shows a circle that will
move and scale with the image. (Due to a limitation in Android, this circle may disappear
when it\'s larger than 2048px.)
Freehand drawing
This subclass adds event detection. Draw a freehand line; it
will move with the image. (Due to a limitation in Android, your drawing may disappear when
it\'s larger than 2048px.)
Configuration
Configuration
Maximum scale
The maximum scale has been set to 50dpi. You can zoom in until the image is very pixellated.
Minimum tile DPI
The minimum tile DPI has been set to 50dpi, to reduce
memory usage. The next layer of tiles will not be loaded until the image is very pixellated.
Pan disabled
Dragging has been disabled. You can only zoom in to the centre point.
Zoom disabled
Zooming has been disabled. You can drag the image around.
Double tap style
On double tap, the tapped point is now zoomed to the center of the screen instead of remaining in the same place.
Double tap style
On double tap, the zoom now happens immediately.
Double tap scale
The double tap zoom scale has been set to 240dpi.
Pan limit center
The pan limit has been changed to PAN_LIMIT_CENTER. Panning stops when a corner reaches the centre of the screen.
Pan limit outside
The pan limit has been changed to PAN_LIMIT_OUTSIDE. Panning stops when the image is just off screen.
Debug
Debug has been enabled. This shows the tile boundaries and sizes.