I am trying to find a way to make arc of the ring. There are the same question, but it was about full ring:
How to draw a ring using canvas in android?
But what do you think how can we make it more abstract?
Now I have something for r1
as outside radius and r2
as inside radius; x
and y
as the center of the arc; start
and end
angles as is.
int r1=100;
int r2=80;
int x=200;
int y=200;
int start=0;
int end=90;
paint.setStyle(Paint.Style.STROKE);
paint.setStrokeWidth(r1-r2);
canvas.drawArc(new RectF(x-r1, y-r1, x+r1, y+r1), start, end, true, paint);
It makes figure with extra lines from the center, and I don't know how to remove it. I provided the result with indifferent background just to make you see the bounds of canvas and transparency inside the figure.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…