GithubHelp home page GithubHelp logo

touchimageview's Introduction

Android: TouchImageView
Created by: Mike Ortiz
Contributions by: 
 * Patrick Lackemacher
 * Babay88
 * @ipsilondev

Date: 2/17/2012
----------------------
Adds panning, pinch zoom, double tap zoom, and fling to Android ImageView.

Usage:
----------------------
Place TouchImageView.java in your project. It can then be used the same as
ImageView. Example:

TouchImageView img = (TouchImageView) findViewById(R.id.img);

If you are using TouchImageView in xml, then you must provide the full package
name, because it is a custom view. Example:

<com.example.touch.TouchImageView
	    android:id="@+id/img”
	    android:layout_width="match_parent"
	    android:layout_height="match_parent" />

API:
----------------------

// Get the current zoom. This is the zoom relative to the initial
// scale, not the original resource.
float getCurrentZoom();

// For a given point on the view (ie, a touch event), returns the
// point relative to the original drawable's coordinate system.
PointF getDrawablePointFromTouchPoint(float x, float y);

// For a given point on the view (ie, a touch event), returns the
// point relative to the original drawable's coordinate system.
PointF getDrawablePointFromTouchPoint(PointF p);

// Get the max zoom multiplier.
float getMaxZoom();

// Get the min zoom multiplier.
float getMinZoom();

// After setting image, a value of true means the new image should maintain
// the zoom of the previous image. False means the image should be resized 
// within the view. Default value is true.
void maintainZoomAfterSetImage(boolean maintainZoom); 

// Set the max zoom multiplier. Default value: 3.
void setMaxZoom(float max);

// Set the min zoom multiplier. Default value: 1.
void setMinZoom(float min);

touchimageview's People

Contributors

babay88 avatar mikeortiz avatar plackemacher avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.