开发者

Android Circle Manipulation

开发者 https://www.devze.com 2023-03-08 04:57 出处:网络
I have a PNG of a full circle. I would lik开发者_运维百科e to do an animation of the circle being drawn through each quadrant (as in it draws itself clockwise). How can i do this? anyone with an examp

I have a PNG of a full circle. I would lik开发者_运维百科e to do an animation of the circle being drawn through each quadrant (as in it draws itself clockwise). How can i do this? anyone with an example?


Good sample code related to drawing arcs / semi circles is available on the Android Developer site here.

For your specific case, I see two approaches.

One is to ditch the PNG file entirely and just draw the circle (best if there's nothing special about the circle: It's just one color, etc).

If you definitely want to use the PNG file, then you can draw a background-colored, filled-in circle on top of that, and animate it in reverse (erasing itself counter-clockwise), which will reveal the circle in your PNG file as a result.


You might be able to do something with Canvas.clipPath(Path) in a custom view.

0

精彩评论

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