Giter VIP home page Giter VIP logo

titouchimageview's Introduction

TiTouchImageView Module

================

Titanium native module wrapper for TouchImageView: https://github.com/MikeOrtiz/TouchImageView

Do you like pinching and zooming on iOS? Wish it just worked on Android too? Here you go!

Get it gitTio

Download the latest distribution ZIP-file and consult the Titanium Documentation on how install it, or simply use the gitTio CLI:

$ gittio install org.iotashan.TiTouchImageView

Referencing the module in your Ti mobile application

Simply add the following lines to your tiapp.xml file:

	<modules>
		<module platform="android">org.iotashan.titouchimageview</module>
	</modules>

To use your module in code, you will need to require it.

	var TiTouchImageView = require('org.iotashan.TiTouchImageView');
	var myView = TiTouchImageView.createView();

API Properties

###image

Accepts a string path to a local file, or a TiBlob image object.

###maxZoom

Maximum zoom value, as a decimal. "5.5" means you can zoom in 550%

###minZoom

Minimum zoom value, as a decimal. "0.5" means you can zoom out to 50%

###zoom

Zoom value for the view, as a decimal. Want to zoom to 300%? Set the value to 3.

API Methods

###createView(props)

Accepts a dictonary of properties. TiTouchImageView extends TiUIView, so you can set other properties like top/left, backgroundColor, etc. Returns the view.

resetZoom()

Resets the zoom to the default value for the view.

scrollTo(x,y)

Scrolls the view to the point specified.

getCurrentZoom()

Returns the current zoom level as a float.

getScrollPosition()

Returns the current scroll position as point co-ordinates (x,y)

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.