public Fling(TouchImageView view, int velocityX, int velocityY) { this.view = view; view.SetState(TouchState.FLING); scroller = new Scroller(view.context); view.matrix.GetValues(view.m); int startX = (int)view.m[Matrix.MtransX]; int startY = (int)view.m[Matrix.MtransY]; int minX, maxX, minY, maxY; if (view.GetImageWidth() > view.viewWidth) { minX = view.viewWidth - (int)view.GetImageWidth(); maxX = 0; } else { minX = maxX = startX; } if (view.GetImageHeight() > view.viewHeight) { minY = view.viewHeight - (int)view.GetImageHeight(); maxY = 0; } else { minY = maxY = startY; } scroller.Fling(startX, startY, (int)velocityX, (int)velocityY, minX, maxX, minY, maxY); currX = startX; currY = startY; }
public DoubleTapZoom(TouchImageView view, float targetZoom, float focusX, float focusY, bool stretchImageToSuper) { this.view = view; view.SetState(TouchState.ANIMATE_ZOOM); startTime = DateTime.Now.Ticks; this.startZoom = view.normalizedScale; this.targetZoom = targetZoom; this.stretchImageToSuper = stretchImageToSuper; PointF bitmapPoint = view.TransformCoordTouchToBitmap(focusX, focusY, false); this.bitmapX = bitmapPoint.X; this.bitmapY = bitmapPoint.Y; // // Used for translating image during scaling // startTouch = view.TransformCoordBitmapToTouch(bitmapX, bitmapY); endTouch = new PointF(view.viewWidth / 2, view.viewHeight / 2); }
public ScaleListener(TouchImageView view) { this.view = view; }
public TouchImageViewListener(TouchImageView view) { this.view = view; }
public GestureListener(TouchImageView view) { this.view = view; }
/** * Set zoom parameters equal to another TouchImageView. Including scale, position, * and ScaleType. * @param TouchImageView */ public void SetZoom(TouchImageView img) { PointF center = img.GetScrollPosition(); SetZoom(img.GetCurrentZoom(), center.X, center.Y, img.GetScaleType()); }