如何画一个封闭的弯曲的形状?弯曲、画一、形状

由网友(苦涩味.)分享简介:我怎么能画(用手指)在Android脆封闭的形状。我可以得到一系列的点froim触摸输入,我需要把它对应(没有通过点去精确地)自定义曲线形状的点。How can I draw (with finger) crisp CLOSED shape on Android. I can get the series of po...

我怎么能画(用手指)在Android脆封闭的形状。我可以得到一系列的点froim触摸输入,我需要把它对应(没有通过点去精确地)自定义曲线形状的点。

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.

推荐答案

跟踪您的接触点,并以构建一个路径(文档链接)可以得出。 路径是建立在这样你可以每个点追加到它,因为他们来的方式,你可以决定什么连接类型(直线,圆弧,贝塞尔),以在中间绘制。

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.

您可以使用初始力度和当前触摸或类似的逻辑之间的接近,以确定何时关闭轮廓,然后就叫的close()

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().

阅读全文

相关推荐

最新文章