使用 Paint.setStrokeJoin() 和 Paint.setStrokeMiter()
I'm curious about what these methods do and how to use them as there doesnt seem to be any details beyond the single sentence descriptions in the Javadocs:
Anybody have some example code or a good description?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
setStrokeJoin
允许设置粗线连接的三种渲染模式。ROUND
表示使用圆形截面来绕过扭结,BEVEL
表示使用另一个短直线段垂直于半角,MITRE
表示两条连接线的外轮廓被拉长直至相交。然而,当角度非常尖锐时,该点可能会变得很远,因此通常会设置一个限制,如果达到一定的锐度,则从MITRE
切换到BEVEL
。该限制由setStrokeMiter
控制。setStrokeJoin
allows to set three modes how a line join of thick lines is rendered.ROUND
means a circular section is used to go around the kink,BEVEL
means another short straigt segment is used perpendicular to the halve angle, andMITER
means the outer contour of the two joining lines is elongated until it intersects. However, when the angle is really sharp, that point can go very far away, so usually a limit is set that switches fromMITER
toBEVEL
, if certain sharpness is reached. This limit is controlled bysetStrokeMiter
.