pinch

Pinch Zoom in android for an imageview?

試著忘記壹切 提交于 2019-11-30 14:43:25
I have one requirement in which i have to zoom in and zoom out images on pinch.. Please if anyone can suggest me pinch zoom functionality for Imageview.???? try this import android.content.Context; import android.graphics.Canvas; import android.graphics.drawable.BitmapDrawable; import android.util.AttributeSet; import android.util.Log; import android.view.MotionEvent; import android.view.ScaleGestureDetector; import android.view.View; public class MyImageView extends View { private static final int INVALID_POINTER_ID = -1; private Drawable mImage; private float mPosX; private float mPosY;

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

╄→尐↘猪︶ㄣ 提交于 2019-11-30 00:58:21
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). 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): - (IBAction)handlePinchGesture:(UIGestureRecognizer *)sender { static CGRect initialBounds; UIView *_view =

How to implement pinch-zoom feature for camera preview [closed]

柔情痞子 提交于 2019-11-29 02:27:33
i tried pinch-zoom feature for image from this .it works fine but how can i implement pinch-zoom feature for camera preview. Please help me. Thanks in advance. This is what I used to add pinch to zoom. The link to the code is here: https://github.com/maxtower/AndroidDocumentScanner/blob/master/app/src/main/java/com/martin/opencv4android/CameraPreview.java private SurfaceHolder mHolder; private Camera mCamera; float mDist = 0; @Override public boolean onTouchEvent(MotionEvent event) { // Get the pointer ID Camera.Parameters params = mCamera.getParameters(); int action = event.getAction(); if

Zoom and Panning ImageView Android

有些话、适合烂在心里 提交于 2019-11-28 19:40:28
I have created a zoom and pan class for an ImageView. Features I am trying to create. - It pans on single finger touch and movement - It zooms and pans on two finger touch and movement For the most part this works very well. It has a slight bug when I do the following: - I pan around with one finger (Status: No problem) - I put down a second finger, zoom and pan (Status: No problem) - I release my second finger (Status: The image jumps a little) Was hoping someone could help me solve this. I am thinking that it must have to do with resetting the mLastTouchX and mLastTouchY in "case MotionEvent

How pinch zoom image in image zoom android? [closed]

半世苍凉 提交于 2019-11-28 05:29:40
I have to display image in an imageview. And what I want to do is just simply pinch and zoom functionality on imageview. You can find below a link to a class created by Jason Polites that will allow you to handle pinch zooms on custom ImageViews: https://github.com/jasonpolites/gesture-imageview . Just include this package into your application and then you will be able to use a custom GestureImaveView in your XML files: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:gesture-image="http://schemas.polites.com/android" android:layout_width="fill_parent" android

Zoom and Panning ImageView Android

倾然丶 夕夏残阳落幕 提交于 2019-11-27 20:34:47
问题 I have created a zoom and pan class for an ImageView. Features I am trying to create. - It pans on single finger touch and movement - It zooms and pans on two finger touch and movement For the most part this works very well. It has a slight bug when I do the following: - I pan around with one finger (Status: No problem) - I put down a second finger, zoom and pan (Status: No problem) - I release my second finger (Status: The image jumps a little) Was hoping someone could help me solve this. I

UIImageView Gestures (Zoom, Rotate) Question

℡╲_俬逩灬. 提交于 2019-11-27 06:03:13
I would like to make 2 operations to an UIImageView zoom, rotate, I have 2 problems: A. I make an operation for zoom for ex. and when I try to make rotation the UIImageView is set to initial size, I would like to know how to keep the zoomed UIImageView and make the rotation from the zoomed image. B. I would like to combine the zoom operation with rotation and I don't know ho to implement this: - (void)viewDidLoad { foo = [[UIImageView alloc]initWithFrame:CGRectMake(100.0, 100.0, 600, 800.0)]; foo.userInteractionEnabled = YES; foo.multipleTouchEnabled = YES; foo.image = [UIImage imageNamed:@

How pinch zoom image in image zoom android? [closed]

懵懂的女人 提交于 2019-11-27 05:36:01
问题 I have to display image in an imageview. And what I want to do is just simply pinch and zoom functionality on imageview. 回答1: You can find below a link to a class created by Jason Polites that will allow you to handle pinch zooms on custom ImageViews: https://github.com/jasonpolites/gesture-imageview. Just include this package into your application and then you will be able to use a custom GestureImaveView in your XML files: <LinearLayout xmlns:android="http://schemas.android.com/apk/res

android imageView: setting drag and pinch zoom parameters

和自甴很熟 提交于 2019-11-26 19:47:34
I am currently developing for Android (my first app) an application which lets users see the subway map and be able to pinch zoom and drag around. I am currently modifying the code found in Hello Android, 3rd Edition and got the pinch zooming and dragging to work. I'm using Matrix as my layout scale. However I now have 3 problems: I tried many things to limit the drag parameters but I can't seem to stop it being dragged off the parent view (and can actually disappear from view). I've tried setting layout parameters in the XML file and it just doesn't work. I can pinch zoom fine but I have

Observing pinch multi-touch gestures in a UITableView

折月煮酒 提交于 2019-11-26 18:36:54
I am looking to implement a pinch in/out on top of a UITableView, I have looked at several methods including this one: Similar question But while I can create a UIViewTouch object and overlay it onto my UITableView, scroll events are not being relayed to my UITableView, I can still select cells, and they respond properly by triggering a transition to a new ViewController object. But I can not scroll the UITableView despite passing the touchesBegan, touchesMoved, and touchesEnded events. This seems to be a classic problem. In my case I wanted to intercept some events over a UIWebView which can