Reputation: 30855
I google it but don't know about this which was possible or not to draw circle like this in android using canvas. If possible then how what the way to do this. below is the image.
I don't know any way to create circle in piece format using canvas
Upvotes: 1
Views: 168
Reputation: 13785
Create 3 different Bipmap
hdip ldip mdip
instead of searching or XML
Upvotes: 0
Reputation: 14472
I can think of 3 options:
Create it as a bitmap which you store in your Drawables or Assets then draw it to the canvas. You can scale it as needed when you load it or by scaling the canvas.
You could draw a circle, then draw 3 lines in a different colour to create the "Y" shape, adjusting the thickness of the lines as you need (or use rectangles)
Use an algorithm to calculate the segment then use drawPath to create the segments individually.
[EDIT] Doh! Elemental's solution is much better...
Upvotes: 1
Reputation: 7521
I believe that this is possible using Canvas.drawArc with the usecenter parameter set true.
take a look at the android docs
Upvotes: 1