V
V
Vlad_isLove2019-06-24 16:01:02
JavaScript
Vlad_isLove, 2019-06-24 16:01:02

How to draw circle in canvas with center?

There is this code:

ctx2.beginPath();
ctx2.clearRect(0, 0, canvas.width, canvas.height);
ctx2.arc(canvas.width/2, canvas.height/2, 100, (Math.PI/180)*-35, (Math.PI/180)*35);
ctx2.fill();
ctx2.stroke();

He draws this:
5d10c8d3dc08c428198137.png
How to draw like this?:
5d10c8f592cbf092355859.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
Nikita, 2019-06-24
@Vlad_isLove

ctx2.beginPath();
ctx2.moveTo(canvas.width/2, canvas.height/2);
ctx2.arc(canvas.width/2, canvas.height/2, 100, 340*Math.PI/180, 20*Math.PI/180);
ctx2.closePath();
ctx2.fill();
Something like this.

G
George Postoronca, 2017-08-22
@georgepostoornca

make triangles on the sides and in the center there is already a simple block with border top and bottom

R
Robert Bl, 2017-08-22
@Robert_blk

In Photoshop, make the edge of the button. And through :after add to the block

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question