Round top corners with Path

Bypetwert

New Member
I'm trying to clip the top-left and the top-right corners of Canvas in java. I understand you can just use \[code\]addRoundRect\[/code\] for all the corners, but I'm unsure what to do for only the top corners.This is what I currently have:\[code\]@Overrideprotected void onDraw(Canvas canvas) { float radius = 12f; Path clipPath = new Path(); RectF rect = new RectF(0, 0, this.getWidth(), this.getHeight()); //uh... //clipPath.addRoundRect(rect, radius, radius, Path.Direction.CW); canvas.clipPath(clipPath); super.onDraw(canvas);} \[/code\]
 
Back
Top