android.graphics.Shader.getLocalMatrix()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(98)

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

Shader.getLocalMatrix介绍

暂无

代码示例

代码示例来源:origin: jakob-grabner/Circle-Progress-View

private void setupBarPaint() {
  if (mBarColors.length > 1) {
    mBarPaint.setShader(new SweepGradient(mCircleBounds.centerX(), mCircleBounds.centerY(), mBarColors, null));
    Matrix matrix = new Matrix();
    mBarPaint.getShader().getLocalMatrix(matrix);
    matrix.postTranslate(-mCircleBounds.centerX(), -mCircleBounds.centerY());
    matrix.postRotate(mStartAngle);
    matrix.postTranslate(mCircleBounds.centerX(), mCircleBounds.centerY());
    mBarPaint.getShader().setLocalMatrix(matrix);
    mBarPaint.setColor(mBarColors[0]);
  } else if (mBarColors.length == 1) {
    mBarPaint.setColor(mBarColors[0]);
    mBarPaint.setShader(null);
  } else {
    mBarPaint.setColor(mBarColorStandard);
    mBarPaint.setShader(null);
  }
  mBarPaint.setAntiAlias(true);
  mBarPaint.setStrokeCap(mBarStrokeCap);
  mBarPaint.setStyle(Style.STROKE);
  mBarPaint.setStrokeWidth(mBarWidth);
  if (mBarStrokeCap != Paint.Cap.BUTT) {
    mShaderlessBarPaint = new Paint(mBarPaint);
    mShaderlessBarPaint.setShader(null);
    mShaderlessBarPaint.setColor(mBarColors[0]);
  }
}

代码示例来源:origin: com.caverock/androidsvg

Matrix  currentShaderMatrix = new Matrix();
if (shader != null) {
 shader.getLocalMatrix(currentShaderMatrix);
 Matrix  newShaderMatrix = new Matrix(currentShaderMatrix);
 newShaderMatrix.postConcat(currentMatrix);

代码示例来源:origin: mkulesh/microMathematics

Matrix  currentShaderMatrix = new Matrix();
if (shader != null) {
 shader.getLocalMatrix(currentShaderMatrix);
 Matrix  newShaderMatrix = new Matrix(currentShaderMatrix);
 newShaderMatrix.postConcat(currentMatrix);

相关文章