油漆中风bug

时间:2017-02-04 21:05:14

标签: android canvas paint stroke

当我在位图上绘制路径时,它不仅会绘制红色笔划,还会绘制内部的深红色笔划,也就是说,我认为是绘图错误

Paint paint = new Paint();
paint.setStyle(Paint.Style.STROKE);
paint.setAntiAlias(true);
paint.setFilterBitmap(true);
paint.setFlags(Paint.FAKE_BOLD_TEXT_FLAG | Paint.HINTING_ON | Paint.ANTI_ALIAS_FLAG);
paint.setDither(true);
paint.setColor(Color.RED);
paint.setStrokeWidth(context.getResources().getDimension(R.dimen.overlay_stroke_width));
paint.setStrokeCap(Paint.Cap.ROUND);
paint.setStrokeJoin(Paint.Join.ROUND);
canvas.drawPath(path, paint);

这是屏幕

Draw path

1 个答案:

答案 0 :(得分:1)

您似乎正在使用另一个Paint重新绘制路径,您必须在绘制填充路径后绘制红色描边drawPath