开发者

display circle in android using drawarc method

开发者 https://www.devze.com 2023-02-01 05:45 出处:网络
how to create circle in android using drawarc method. or how to split a circle in 6 parts. each part contain differ开发者_如何学运维ent color. I would create an array holding 6 colors (paint), then u

how to create circle in android using drawarc method. or how to split a circle in 6 parts. each part contain differ开发者_如何学运维ent color.


I would create an array holding 6 colors (paint), then use a loop to create the 6 parts of the arc

Like

  for(int i = 0; i < color.length; i++){
     drawArc (RectF oval, 60*i , 60*(i+1), True, color(i))
  }

Or

  for(int i = 0; i < color.length; i++){
     drawArc (RectF oval, (360/color.length)*i , (360/color.length)*(i+1), True, color(i))
  }
0

精彩评论

暂无评论...
验证码 换一张
取 消