本文整理汇总了Java中android.graphics.PathDashPathEffect类的典型用法代码示例。如果您正苦于以下问题:Java PathDashPathEffect类的具体用法?Java PathDashPathEffect怎么用?Java PathDashPathEffect使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PathDashPathEffect类属于android.graphics包,在下文中一共展示了PathDashPathEffect类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onDraw
import android.graphics.PathDashPathEffect; //导入依赖的package包/类
@Override protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
//无效果
mEffects[0] = null;
//拐角处变得圆滑
mEffects[1] = new CornerPathEffect(30);
//线段上就会产生许多杂点
mEffects[2] = new DiscretePathEffect(3.0F, 5.0F);
//绘制虚线
mEffects[3] = new DashPathEffect(new float[] { 20, 10, 5, 10 }, 0);
Path path = new Path();
path.addRect(0, 0, 8, 8, Path.Direction.CCW);
//设置点的图形,即方形点的虚线,圆形点的虚线
mEffects[4] = new PathDashPathEffect(path, 12, 0, PathDashPathEffect.Style.ROTATE);
//组合PathEffect
mEffects[5] = new ComposePathEffect(mEffects[3], mEffects[1]);
for (int i = 0; i < mEffects.length; i++) {
mPaint.setPathEffect(mEffects[i]);
canvas.drawPath(mPath, mPaint);
canvas.translate(0, 200);
}
}
开发者ID:liuguoquan727,项目名称:android-study,代码行数:23,代码来源:PathEffectView.java
示例2: setPoints
import android.graphics.PathDashPathEffect; //导入依赖的package包/类
public void setPoints(ArrayList<float[]> pointsToPath){
synchronized (pointsToPath) {
this.points = pointsToPath;
float[] startPoint = convertXYToLinePoint(points.get(0));
path.moveTo(startPoint[0], startPoint[1]);
for (int i = 0; i<this.points.size(); i++) {
float[] linePoint = convertXYToLinePoint(points.get(i));
path.lineTo(linePoint[0],linePoint[1]);
}
}
pathMeasure = new PathMeasure(path, false);
pathLength = pathMeasure.getLength(); // the interpolated length of the entire path as it would be drawn on the screen in dp
PathEffect pathEffect = new PathDashPathEffect(makeConvexArrow(15.0f, 15.0f), 5.0f, 0.0f, PathDashPathEffect.Style.ROTATE);
paintSettings.setPathEffect(pathEffect);
invalidate();
}
开发者ID:DifferentialEq,项目名称:DirectionFieldAndroid,代码行数:17,代码来源:PhasePlane.java
示例3: initPaint
import android.graphics.PathDashPathEffect; //导入依赖的package包/类
private void initPaint() {
mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setStrokeWidth(5);
mPaint.setColor(Color.RED);
mPath = new Path();
mPath.moveTo(0, 0);
for(int i = 0;i<=30;i++){
mPath.lineTo(i*35, (float)Math.random()*100);
}
mEffects = new PathEffect[7];
mEffects[0] = null;
mEffects[1] = new CornerPathEffect(10);
mEffects[2] = new DiscretePathEffect(3.0F, 5.0F);
mEffects[3] = new DashPathEffect(new float[] { 20, 10, 5, 10 }, mPhase);
Path path = new Path();
path.addRect(0, 0, 8, 8, Path.Direction.CCW);
mEffects[4] = new PathDashPathEffect(path, 12, mPhase, PathDashPathEffect.Style.ROTATE);
mEffects[5] = new ComposePathEffect(mEffects[2], mEffects[4]);
mEffects[6] = new SumPathEffect(mEffects[4], mEffects[3]);
}
开发者ID:xu6148152,项目名称:binea_project_for_android,代码行数:28,代码来源:PathEffectView.java
示例4: Path
import android.graphics.PathDashPathEffect; //导入依赖的package包/类
private void ˊ(Canvas paramCanvas, Paint paramPaint)
{
int i = this.ˈ.getResources().getColor(2131230762);
Path localPath1 = new Path();
localPath1.addCircle(0.0F, 0.0F, 1.0F, Path.Direction.CW);
paramPaint.setStyle(Paint.Style.STROKE);
paramPaint.setStrokeWidth(1.0F);
paramPaint.setPathEffect(new PathDashPathEffect(localPath1, 6.0F, 1.0F, PathDashPathEffect.Style.TRANSLATE));
for (int j = 0; j < 8; j++)
{
float f2 = this.ˎ * j + this.ʻ;
if (j % 2 == 1)
paramPaint.setColor(i);
else
paramPaint.setColor(-1);
Path localPath3 = new Path();
localPath3.moveTo(this.ˏ, f2);
localPath3.lineTo(this.ʽ, f2);
paramCanvas.drawPath(localPath3, paramPaint);
}
paramPaint.setColor(-1);
for (int k = 1; k <= 7; k++)
{
float f1 = this.ˋ * k + this.ˏ;
this.ʿ[(k - 1)] = f1;
Path localPath2 = new Path();
localPath2.moveTo(f1, this.ʻ);
localPath2.lineTo(f1, this.ͺ);
paramCanvas.drawPath(localPath2, paramPaint);
}
this.ʿ[(-1 + this.ʿ.length)] = (this.ι - this.ᐝ);
}
开发者ID:mmmsplay10,项目名称:QuizUpWinner,代码行数:33,代码来源:Chart.java
示例5: getTrianglePathEffect
import android.graphics.PathDashPathEffect; //导入依赖的package包/类
private PathEffect getTrianglePathEffect(int strokeWidth) {
return new PathDashPathEffect(
getTriangle(strokeWidth),
strokeWidth,
0.0f,
PathDashPathEffect.Style.ROTATE);
}
开发者ID:chiuki,项目名称:android-graphics-demo,代码行数:8,代码来源:HollowTextActivity.java
示例6: makeEffects
import android.graphics.PathDashPathEffect; //导入依赖的package包/类
private static void makeEffects(PathEffect[] e, float phase) {
e[0] = null; // no effect
e[1] = new CornerPathEffect(10);
e[2] = new DashPathEffect(new float[] {10, 5, 5, 5}, phase);
e[3] = new PathDashPathEffect(makePathDash(), 12, phase,
PathDashPathEffect.Style.ROTATE);
e[4] = new ComposePathEffect(e[2], e[1]);
e[5] = new ComposePathEffect(e[3], e[1]);
}
开发者ID:garlicG,项目名称:CUT-IN-material,代码行数:10,代码来源:PathEffectsCutin.java
示例7: setPhase
import android.graphics.PathDashPathEffect; //导入依赖的package包/类
/**
* Will be called by animator
* @param phase
*/
private void setPhase(float phase) {
pathDashEffect = new PathDashPathEffect(makeDot(OVAL_RADIUS), STAMP_SPACING, phase, PathDashPathEffect.Style.ROTATE);
invalidate();
}
开发者ID:flipkart-incubator,项目名称:springy-heads,代码行数:9,代码来源:ChatHeadOverlayView.java
示例8: SafeDashPathEffect
import android.graphics.PathDashPathEffect; //导入依赖的package包/类
public SafeDashPathEffect(float[] intervals, float phase, float strokeWidth) {
super(createSafeDashedPath(intervals, phase, strokeWidth, null), floatSum(intervals), phase,
PathDashPathEffect.Style.MORPH);
}
开发者ID:RoProducts,项目名称:rastertheque,代码行数:5,代码来源:SafeDashPathEffect.java
注:本文中的android.graphics.PathDashPathEffect类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论