pinch

“Pinch to Zoom” using AutoLayout

喜你入骨 提交于 2019-12-04 12:13:38
I have followed many "Pinch to Zoom" tutorials I found online, and have done reading on AutoLayout, but I can't get it to work in my project. My whole project uses AutoLayout, so I don't want to turn it off. I am loading a huge UIImage (EG: 5000px on long edge) into a UIImageView, and i'd like to be able to pinch to zoom and move around the zoomed in image. I've tried using UIImageView inside a UISrollView, but I couldn't get it to work properly. The closest I could get was some random "glitching" where the image moved erratically when pinched. Has anybody got 'Pinch to Zoom' to work using

How to keep an image inside the screen limits while using pinch zoom and drag gestures?

女生的网名这么多〃 提交于 2019-12-04 12:07:21
问题 I'm building an app that uses the pinch zoom and drag. The problem is that for now I can drag the picture out of it bounds. I wanted to know how can I use drag and make sure the image stays on the screen at the same time. Here is my code : public boolean onTouch(View v, MotionEvent event) { ImageView view = (ImageView)v; //handle touch events here. switch (event.getAction() & MotionEvent.ACTION_MASK) { case MotionEvent.ACTION_DOWN: savedMatrix.set(matrix); start.set(event.getX(), event.getY()

UIPinchGestureRecognizer Scale view in different x and y directions

爷,独闯天下 提交于 2019-12-04 11:37:27
i don't want to use the scale as classic zoom, instead i want to change the form of quadrates to a rectangle for example. After a lot of trying i'm that far that my fingers are the corners of the rectangle. So but if i start a new pinch gesture inside my view gets smaller to my fingers instead of getting bigger like the normal scale does. if ([gestureRecognizer numberOfTouches] >1) { //getting width and height between gestureCenter and one of my finger float x = [gestureRecognizer locationInView:self].x - [gestureRecognizer locationOfTouch:0 inView:self].x; if (x<0) { x *= -1; } float y =

Disable Chrome pinch zoom for use in kiosk

安稳与你 提交于 2019-12-04 07:41:01
问题 We are using Chrome in kiosk mode and accidentally users are causing the application to zoom with the recent addition of pinch zoom support. They then think they've broken it and simply walk away leaving the application (and subsequently a 55" touch screen) in a broken state. Now the only thing to work has been stopping event propagation for touch events over 2 points. Issues with that are we can't do multitouch apps in that case and if you act fast the browser reacts before javascript. Which

Detecting pinch in Android

杀马特。学长 韩版系。学妹 提交于 2019-12-04 01:31:20
I would like to handle pinch events in my Android application to zoom in and out. I believe Android 2.0 has multi-touch functionality, and heard that Android 1.6 might or might not support it depending of the device. What's the best way to detect pinch events, while degrading gracefully for devices that don't support it? I'm targeting Android 1.5 upwards. Damian A great article by Ed Burnette (Hello Android Author) on multi touch (including pinch zoom) can be found here: http://www.zdnet.com/blog/burnette/how-to-use-multi-touch-in-android-2/1747 Here's an article on the Android developer blog

is there a class to get the default picture viewer in an app?

允我心安 提交于 2019-12-03 21:12:05
I don't want to access the images on the iphone, I want to display an image from my app, but like you view pictures in the picture album of the iphone - with all the pinch and zoom controls and such. Is this possible? I thought there might (by chance) be some class like the AVMediaPlayer class that would do this? Thanks Tom If you're targeting 4.0 or later you can use QLPreviewController : Include #import <QuickLook/QuickLook.h> in your class Here is how to create one: Class qlookclass = NSClassFromString(@"QLPreviewController"); if(qlookclass){ //check if the image exists if([[NSFileManager

Pinch to zoom with Hammer.js

帅比萌擦擦* 提交于 2019-12-03 21:01:28
I want a pinch to Zoom function for an image. I want it to zoom in the area where the fingers are. My index is only <div id="wrapper" style="-webkit-transform: translate3d(0,0,0);overflow: hidden;"> </div> And my script for zooming and scrolling is similar with this example . I have made a few changes to fit with my project My problem is in case 'transform': rotation = last_rotation + ev.gesture.rotation; scale = Math.max(1, Math.min(last_scale * ev.gesture.scale, 10)); break; How can I change it so that it doesn't zoom into the center of the picture but at place where the first finger have

How can I use pinch zoom(UIPinchGestureRecognizer) to change width of a UITextView?

こ雲淡風輕ζ 提交于 2019-12-03 18:43:51
问题 I can get the UIPinchGestureRecognizer handler to work with scaling an object but I don't want to scale I want to change the size. For example I have a UITextView and I've attached a UIPinchGestureRecognizer gesture to it and if the user pinches I want to change the width of the textview to match the pinch. I don't want to scale it so the UITextView is larger(zooming). 回答1: I am doing the very same thing. I will update this post if I found how to do it. Try this, it work for me (for UIView):

Pinch Zoom in webview [Android]

别等时光非礼了梦想. 提交于 2019-12-03 12:50:18
On my website, which is loaded in the webview, there is a map. There are also java scripts that detects double tap for zoom, dragging etc. But is it possible to have a javascript that detects the use of pinch zoom ? there are several examples of it working on an iphone, and on my website there is a script for the pinch zoom but it is only working on iphone..... Is it possible to get it to work on Android ? Thanks There's an open-source library called android-pinch that you can include in your project to enable pinch zoom if you switch your WebView to a WebImageView . Here's an example of usage

is possible to zoom in/out a UIImageView in custom cell of a UICollectionView only when pinch the cell's imageView?

女生的网名这么多〃 提交于 2019-12-03 10:20:54
问题 I have a CollectionView that have one custom cell. I want to zoom in/out imageView in cell, so i add pinch gesture at CollectionView.m when i add gesture to self.collectionView, like this: [self.collectionView addGestureRecognizer:pinchGesture]; it works! my cell.imageView can zoom in/out, but when i pinch other place(not in cell's imageView, my cell.imageView still zoom in/out with the gesture, I want the cell.imageView zoom in/out just when user pinch the cell.imageView, so i try to add