本文整理了Java中android.graphics.Shader.getLocalMatrix()
方法的一些代码示例,展示了Shader.getLocalMatrix()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Shader.getLocalMatrix()
方法的具体详情如下:
包路径:android.graphics.Shader
类名称: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);
内容来源于网络,如有侵权,请联系作者删除!