PathEffectView.java 文件源码

java
阅读 28 收藏 0 点赞 0 评论 0

项目:binea_project_for_android 作者:
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]);

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号