ImageView setImageMatrix - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ImageView setImageMatrix method.

This code example shows how to use the following methods: layout, getDrawable, setImageMatrix
		scheduleControlTimeout(); 
	} 
 
	private void computeBaseMatrix() 
	{ 
		Drawable d = imageView.getDrawable();
		baseMatrix.reset();
 
		if (d != null) {
			// The base matrix is the matrix that displays the entire image bitmap. 
			// It orients the image when orientation is set and scales in X and Y independently,  
			// so that src matches dst exactly. 
			// This may change the aspect ratio of the src. 
			Rect r = new Rect();
			getDrawingRect(r);
			int intrinsicWidth = d.getIntrinsicWidth();
			int intrinsicHeight = d.getIntrinsicHeight();
			int dwidth = intrinsicWidth;
			int dheight = intrinsicHeight;
 

8
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: setImageMatrix
			} 
			break; 
		} 
 
		// Perform the transformation 
		imgView.setImageMatrix(matrix);
		CheckView(); 
		return true; // indicate event was handled 
	} 
 
    /** 
     * 限制最大最小缩放比例,自动居中 
     */ 
    private void CheckView() { 
        float p[] = new float[9];
        matrix.getValues(p);
        if (mode == ZOOM) {
            if (p[0] < minScaleR) {
                matrix.setScale(minScaleR, minScaleR);
            } 
Full Snippet Info
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: setImageMatrix
        // 値を取得 
        float value = event.values[0];
        // Matrixに回転する角度と中心座標をセット 
        mMatrix.postRotate(mPreValue - value, mCenterX, mCenterY);
        // 回転! 
        mImageView.setImageMatrix(mMatrix);
        // 今回の値を保持 
        mPreValue = value;
    } 
} 
Full Snippet Info
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: postScale, setImageMatrix
 
 
 
                        Matrix matrixMove=new Matrix(matrix);
                        matrixMove.postTranslate(newPositionX,newPositionY);
                        Matrix scaleMatrix=new Matrix(matrixMove);
                       // scaleMatrix.postTranslate(newPositionX,newPositionY); 
 
                       // scaleMatrix.postScale(ss,ss); 
                        scaleMatrix.postScale(ss,ss);
                        ((ImageView) v).setImageMatrix(scaleMatrix);
 
                       // action_on_MOVE_DROP(event,v); 
 
 
                    } 
                break; 
 
                case MotionEvent.ACTION_POINTER_DOWN:  oldDist = spacing(event); mode = ZOOM; mpointOld=midPoint(event); break;
                case MotionEvent.ACTION_UP:
Full Snippet Info
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: getValues, postScale, set, setScale, setImageMatrix
    		//RectF rectF = new RectF(0, 0, initImageWidth, initImageHeight); 
    		//m.mapRect(rectF); 
    		if (mode == ZOOM) {
            	float newDist = spacing(ev);
                if (newDist > 10f) {
                    matrix.set(savedMatrix);
                    float tScale = newDist / dist;
                    if(tScale>=0.35f) {
                    	matrix.postScale(tScale, tScale, mid.x, mid.y);
                    } 
                } 
            } 
    		 
			final int pointerIndex = ev.findPointerIndex(mActivePointerId);
			final float x = ev.getX();
			final float y = ev.getY();
			final int xDiff = (int) Math.abs(x - mLastMotionX);
			final int yDiff = (int) Math.abs(y - mLastMotionY);
 
			final int touchSlop = mTouchSlop;

5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: setImageMatrix
					float scale = newDistance / oldDistance;
					matrix.postScale(scale, scale, middle.x, middle.y);
				} 
			} 
 
			view.setImageMatrix(matrix);
			return true; 
		} 
 
		private float spaceBetweenTwoFingers(MotionEvent event) {
			float x = event.getX(0) - event.getX(1);
			float y = event.getY(0) - event.getY(1);
			return (float) Math.sqrt(x * x + y * y);
		} 
 
		private void midPointBetweenTwoFingers(PointF point, MotionEvent event) {
			float x = event.getX(0) + event.getX(1);
			float y = event.getY(0) + event.getY(1);
			point.set(x / 2, y / 2);
		} 
Full Snippet Info
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: setImageMatrix
 
        private void setScaleFactor(float sf) {
            mScale = sf;
            Matrix m = new Matrix();
            m.postScale(sf,sf);
            mContent.setImageMatrix(m);
        } 
 
        private float getScaleFactor() { 
            return mScale;
        } 
 
    } 
 
} 
Full Snippet Info
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: setImageMatrix
					float scale = newDistance / oldDistance;
					matrix.postScale(scale, scale, middle.x, middle.y);
				} 
			} 
 
			view.setImageMatrix(matrix);
			return true; 
		} 
 
		private float spaceBetweenTwoFingers(MotionEvent event) {
			float x = event.getX(0) - event.getX(1);
			float y = event.getY(0) - event.getY(1);
			return (float) Math.sqrt(x * x + y * y);
		} 
 
		private void midPointBetweenTwoFingers(PointF point, MotionEvent event) {
			float x = event.getX(0) + event.getX(1);
			float y = event.getY(0) + event.getY(1);
			point.set(x / 2, y / 2);
		} 
Full Snippet Info
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: setImageMatrix
 
 
    //rotate the wheel by the given angle 
    private void rotateWheel(float degrees) {
        matrix.postRotate(degrees, wheelWidth / 2, wheelHeight / 2);
        wheel.setImageMatrix(matrix);
 
        //add the rotation to the total rotation 
        total_rotation = total_rotation + degrees;
 
 
    } 
 
} 
Full Snippet Info
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods: setImageMatrix
		case MotionEvent.ACTION_MOVE:
			switch (mode) {
			case DRAG:
				matrix.set(moveMatrix);
				matrix.postTranslate(event.getX() - point.x, event.getY() - point.y);
				view.setImageMatrix(matrix);
				break; 
			case ZOOM:
				if (mode == ZOOM) {
					float currentLength = getLength(event);
					middle = getMiddle(event, middle);
					if (currentLength > MIN_LENGTH) {
						matrix.set(moveMatrix);
						float scale = filter(matrix,currentLength / initLength);
						matrix.postScale(scale, scale, middle.x, middle.y);
						view.setImageMatrix(matrix);	
					} 
					break; 
				} 
				break; 
			} 
Full Snippet Info
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related ImageView setImageMatrix Questions & Answers:

setImageMatrix Method Overview
See Code Examples for other Android ImageView Methods: