How to draw a closed curved shape?

余生颓废 提交于 2019-12-06 15:19:05

问题


How can I draw (with finger) crisp CLOSED shape on Android. I can get the series of points froim touch input and I need to put custom curved shape which corresponds (doesn't have to go exactly through the points) the points.


回答1:


Track your touch points and apply them in order to construct a Path (docs link) that can be drawn. Path is set up in such a way that you can append each point to it as they come in, and you can decide what type of connection (line, arc, bezier) to draw in between.

You can use proximity between the initial touch and current touch or similar logic to determine when to close the contour, and then just call close().



来源:https://stackoverflow.com/questions/13312658/how-to-draw-a-closed-curved-shape

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!