Skip to content
Android ImageView widget with zoom and pan capabilities
Branch: master
Clone or download
sephiroth74 Merge pull request #98 from sumit-anantwar/master
update Readme to reflect the newly added DisplayTypes
Latest commit bfe833a Jun 30, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
demo
gradle add *FIT_HEIGHT* and *FIT_WIDTH* DisplayTypes Jun 27, 2017
library reformat code to satisfy Checkstyle Jun 27, 2017
.gitignore gradle Nov 19, 2013
.travis.yml update travis.yml trying to fix failed Travis Builds Jun 27, 2017
LICENSE
README.md
build.gradle
checkstyle.gradle
gradle.properties
gradlew uploadArchives Dec 6, 2015
gradlew.bat gradle Nov 10, 2013
settings.gradle

README.md

ImageViewTouch for Android

Badge

Build Status Download

ImageViewTouch is an android ImageView widget with zoom and pan capabilities. This is an implementation of the ImageView widget used in the Gallery app of the Android opensource project.

Checkout the repository and run the ImageViewTouchTest project to see how it works. Beside the superclass setImageBitmap method it offers the following methods:

  • setImageBitmap( final Bitmap bitmap, Matrix matrix );
  • setImageBitmap( final Bitmap bitmap, Matrix matrix, float minZoom, float maxZoom );

If you want to load a new Bitmap with a particular zoom/pan state (let's say the same from another ImageView ), you can call:

Matrix matrix = mImageView1.getDisplayMatrix();
mImageView2.setImageBitmap( bitmap, matrix );

Tweaks

The initial display state can be set, using public void setDisplayType( DisplayType type ), as:

  • DisplayType.FIT_TO_SCREEN: The image loaded will always fit the current view's bounds.
  • DisplayType.NONE: The image will be presented with its current dimensions if smaller than the image bounds, otherwise it will be scaled to fit its contents inside the screen.
  • DisplayType.FIT_HEIGHT: The image loaded will always fit the height of the current view.
  • DisplayType.FIT_WIDTH: The image loaded will always fit the width of the current view.

The default display state is `DisplayState.NONE'.

##Usage (Maven) it.sephiroth.android.library.imagezoom imagezoom 2.3.0

##Usage (Gradle)

dependencies {
	compile 'it.sephiroth.android.library.imagezoom:imagezoom:+'
}

##LICENSE

This software is provided under the MIT license:
http://opensource.org/licenses/mit-license.php

##Author

Alessandro Crugnola

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.