android.widget.ImageView.setImageMatrix()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(7.7k)|赞(0)|评价(0)|浏览(334)

本文整理了Java中android.widget.ImageView.setImageMatrix()方法的一些代码示例,展示了ImageView.setImageMatrix()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ImageView.setImageMatrix()方法的具体详情如下:
包路径:android.widget.ImageView
类名称:ImageView
方法名:setImageMatrix

ImageView.setImageMatrix介绍

暂无

代码示例

代码示例来源:origin: Yalantis/uCrop

@Override
public void setImageMatrix(Matrix matrix) {
  super.setImageMatrix(matrix);
  mCurrentImageMatrix.set(matrix);
  updateCurrentImagePoints();
}

代码示例来源:origin: androidquery/androidquery

public RatioDrawable(Resources res, Bitmap bm, ImageView iv, float ratio, float anchor){
  
  super(res, bm);
  
  this.ref = new WeakReference<ImageView>(iv);
  this.ratio = ratio;
  this.anchor = anchor;
  
  iv.setScaleType(ScaleType.MATRIX);
  
  Matrix m = new Matrix();
  iv.setImageMatrix(m);
  
  adjust(iv, bm, false);
  
}

代码示例来源:origin: alexvasilkov/GestureViews

@Override
public void setImageMatrix(Matrix matrix) {
  super.setImageMatrix(matrix);
  setup();
}

代码示例来源:origin: igreenwood/SimpleCropView

@Override public void run() {
  imageView.setImageMatrix(Utils.getMatrixFromExifOrientation(exifRotation));
  imageView.setImageBitmap(sampledBitmap);
 }
});

代码示例来源:origin: chrisbanes/PhotoView

private void setImageViewMatrix(Matrix matrix) {
  mImageView.setImageMatrix(matrix);
  // Call MatrixChangedListener if needed
  if (mMatrixChangeListener != null) {
    RectF displayRect = getDisplayRect(matrix);
    if (displayRect != null) {
      mMatrixChangeListener.onMatrixChanged(displayRect);
    }
  }
}

代码示例来源:origin: stackoverflow.com

view.setImageMatrix(matrix);
return true;

代码示例来源:origin: sephiroth74/ImageViewZoom

@Override
public void setImageMatrix(Matrix matrix) {
  Matrix current = getImageMatrix();
  boolean needUpdate = false;
  if (matrix == null && !current.isIdentity() || matrix != null && !current.equals(matrix)) {
    needUpdate = true;
  }
  super.setImageMatrix(matrix);
  if (needUpdate) {
    onImageMatrixChanged();
  }
}

代码示例来源:origin: jiangqqlmj/FastDev4Android

private void setImageViewMatrix(Matrix matrix) {
  ImageView imageView = getImageView();
  if (null != imageView) {
    checkImageViewScaleType();
    imageView.setImageMatrix(matrix);
    // Call MatrixChangedListener if needed
    if (null != mMatrixChangeListener) {
      RectF displayRect = getDisplayRect(matrix);
      if (null != displayRect) {
        mMatrixChangeListener.onMatrixChanged(displayRect);
      }
    }
  }
}

代码示例来源:origin: wangdan/AisenWeiBo

private void setImageViewMatrix(Matrix matrix) {
  ImageView imageView = getImageView();
  if (null != imageView) {
    checkImageViewScaleType();
    imageView.setImageMatrix(matrix);
    // Call MatrixChangedListener if needed
    if (null != mMatrixChangeListener) {
      RectF displayRect = getDisplayRect(matrix);
      if (null != displayRect) {
        mMatrixChangeListener.onMatrixChanged(displayRect);
      }
    }
  }
}

代码示例来源:origin: wangdan/AisenWeiBo

private void setImageViewMatrix(Matrix matrix) {
  ImageView imageView = getImageView();
  if (null != imageView) {
    checkImageViewScaleType();
    imageView.setImageMatrix(matrix);
    // Call MatrixChangedListener if needed
    if (null != mMatrixChangeListener) {
      RectF displayRect = getDisplayRect(matrix);
      if (null != displayRect) {
        mMatrixChangeListener.onMatrixChanged(displayRect);
      }
    }
  }
}

代码示例来源:origin: ArthurHub/Android-Image-Cropper

@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
 mAnimRect.left =
   mStartCropWindowRect.left
     + (mEndCropWindowRect.left - mStartCropWindowRect.left) * interpolatedTime;
 mAnimRect.top =
   mStartCropWindowRect.top
     + (mEndCropWindowRect.top - mStartCropWindowRect.top) * interpolatedTime;
 mAnimRect.right =
   mStartCropWindowRect.right
     + (mEndCropWindowRect.right - mStartCropWindowRect.right) * interpolatedTime;
 mAnimRect.bottom =
   mStartCropWindowRect.bottom
     + (mEndCropWindowRect.bottom - mStartCropWindowRect.bottom) * interpolatedTime;
 mCropOverlayView.setCropWindowRect(mAnimRect);
 for (int i = 0; i < mAnimPoints.length; i++) {
  mAnimPoints[i] =
    mStartBoundPoints[i] + (mEndBoundPoints[i] - mStartBoundPoints[i]) * interpolatedTime;
 }
 mCropOverlayView.setBounds(mAnimPoints, mImageView.getWidth(), mImageView.getHeight());
 for (int i = 0; i < mAnimMatrix.length; i++) {
  mAnimMatrix[i] =
    mStartImageMatrix[i] + (mEndImageMatrix[i] - mStartImageMatrix[i]) * interpolatedTime;
 }
 Matrix m = mImageView.getImageMatrix();
 m.setValues(mAnimMatrix);
 mImageView.setImageMatrix(m);
 mImageView.invalidate();
 mCropOverlayView.invalidate();
}

代码示例来源:origin: ArthurHub/Android-Image-Cropper

mImageView.startAnimation(mAnimation);
} else {
 mImageView.setImageMatrix(mImageMatrix);

代码示例来源:origin: tianshaojie/AndroidFine

private void resetImageRotation() {
  if (null != mHeaderImageMatrix) {
    mHeaderImageMatrix.reset();
    mHeaderImage.setImageMatrix(mHeaderImageMatrix);
  }
}

代码示例来源:origin: tianshaojie/AndroidFine

protected void onPullImpl(float scaleOfLayout) {
  float angle;
  if (mRotateDrawableWhilePulling) {
    angle = scaleOfLayout * 90f;
  } else {
    angle = Math.max(0f, Math.min(180f, scaleOfLayout * 360f - 180f));
  }
  mHeaderImageMatrix.setRotate(angle, mRotationPivotX, mRotationPivotY);
  mHeaderImage.setImageMatrix(mHeaderImageMatrix);
}

代码示例来源:origin: tianshaojie/AndroidFine

public RotateLoadingLayout(Context context, Mode mode, Orientation scrollDirection, TypedArray attrs) {
  super(context, mode, scrollDirection, attrs);
  mRotateDrawableWhilePulling = attrs.getBoolean(R.styleable.PullToRefresh_ptrRotateDrawableWhilePulling, true);
  mHeaderImage.setScaleType(ScaleType.MATRIX);
  mHeaderImageMatrix = new Matrix();
  mHeaderImage.setImageMatrix(mHeaderImageMatrix);
  mRotateAnimation = new RotateAnimation(0, 720, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF,
      0.5f);
  mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
  mRotateAnimation.setDuration(ROTATION_ANIMATION_DURATION);
  mRotateAnimation.setRepeatCount(Animation.INFINITE);
  mRotateAnimation.setRepeatMode(Animation.RESTART);
}

代码示例来源:origin: tianshaojie/AndroidFine

@Override
protected void onLoadingDrawableSet(Drawable imageDrawable) {
  if (null != imageDrawable) {
    final int dHeight = imageDrawable.getIntrinsicHeight();
    final int dWidth = imageDrawable.getIntrinsicWidth();
    /**
     * We need to set the width/height of the ImageView so that it is
     * square with each side the size of the largest drawable dimension.
     * This is so that it doesn't clip when rotated.
     */
    ViewGroup.LayoutParams lp = mHeaderImage.getLayoutParams();
    lp.width = lp.height = Math.max(dHeight, dWidth);
    mHeaderImage.requestLayout();
    /**
     * We now rotate the Drawable so that is at the correct rotation,
     * and is centered.
     */
    mHeaderImage.setScaleType(ScaleType.MATRIX);
    Matrix matrix = new Matrix();
    matrix.postTranslate((lp.width - dWidth) / 2f, (lp.height - dHeight) / 2f);
    matrix.postRotate(getDrawableRotationAngle(), lp.width / 2f, lp.height / 2f);
    mHeaderImage.setImageMatrix(matrix);
  }
}

代码示例来源:origin: multidots/android-app-common-tasks

view.setImageMatrix(matrix);
return true; // indicate event was handled

代码示例来源:origin: multidots/android-app-common-tasks

view.setImageMatrix(matrix);
return true; // indicate event was handled

代码示例来源:origin: tianshaojie/AndroidFine

Matrix matrix = new Matrix();
  matrix.setRotate(180f, arrowD.getIntrinsicWidth() / 2f, arrowD.getIntrinsicHeight() / 2f);
  mArrowImageView.setImageMatrix(matrix);
  break;
default:

代码示例来源:origin: guolindev/giffun

@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
 mAnimRect.left =
   mStartCropWindowRect.left
     + (mEndCropWindowRect.left - mStartCropWindowRect.left) * interpolatedTime;
 mAnimRect.top =
   mStartCropWindowRect.top
     + (mEndCropWindowRect.top - mStartCropWindowRect.top) * interpolatedTime;
 mAnimRect.right =
   mStartCropWindowRect.right
     + (mEndCropWindowRect.right - mStartCropWindowRect.right) * interpolatedTime;
 mAnimRect.bottom =
   mStartCropWindowRect.bottom
     + (mEndCropWindowRect.bottom - mStartCropWindowRect.bottom) * interpolatedTime;
 mCropOverlayView.setCropWindowRect(mAnimRect);
 for (int i = 0; i < mAnimPoints.length; i++) {
  mAnimPoints[i] =
    mStartBoundPoints[i] + (mEndBoundPoints[i] - mStartBoundPoints[i]) * interpolatedTime;
 }
 mCropOverlayView.setBounds(mAnimPoints, mImageView.getWidth(), mImageView.getHeight());
 for (int i = 0; i < mAnimMatrix.length; i++) {
  mAnimMatrix[i] =
    mStartImageMatrix[i] + (mEndImageMatrix[i] - mStartImageMatrix[i]) * interpolatedTime;
 }
 Matrix m = mImageView.getImageMatrix();
 m.setValues(mAnimMatrix);
 mImageView.setImageMatrix(m);
 mImageView.invalidate();
 mCropOverlayView.invalidate();
}

相关文章

ImageView类方法