How to draw smooth / rounded path? How to draw smooth / rounded path? android android

How to draw smooth / rounded path?


Maybe this will create what you want

paint.setColor(color);                    // set the colorpaint.setStrokeWidth(size);               // set the sizepaint.setDither(true);                    // set the dither to truepaint.setStyle(Paint.Style.STROKE);       // set to STOKEpaint.setStrokeJoin(Paint.Join.ROUND);    // set the join to round you wantpaint.setStrokeCap(Paint.Cap.ROUND);      // set the paint cap to round toopaint.setPathEffect(new CornerPathEffect(10) );   // set the path effect when they join.paint.setAntiAlias(true);                         // set anti alias so it smooths

:)


You probably don't want to lineTo(c, d) and then immediately moveTo(c, d) which is the same point. If you do this, you won't get a nice corner join on the two line segments, which may look like an ugly gap.

Try removing that moveTo.