开发者

what is path & subpath in Java2D?

I hope it is not a silly question:

What i开发者_StackOverflows path, subpath, and endpoint in Java2D?


Most commonly, a path is a combination of lines and cubic Bezier segments. This is represented procedurally by a sequence of moveTo, lineTo, curveTo, and closePath methods. These correspond to the operators of the same name in PostScript (but lowercased), from which the Java2D imaging model derives. (Also, there is quadTo, which is a quadratic Bezier segment, but this is less important and easily simulated by curveTo if needed).

A subpath is a connected sequence of segments. It doesn't have its own class, but a GeneralPath object can contain multiple subpaths, each beginning with its own moveTo().

Endpoints are the points at the ends of each line segment. Their (x, y) coordinates are the arguments to moveTo and lineTo, and the last two arguments to curveTo (the other arguments are "control points" which affect the shape of the curve segment but not the endpoints).

Hope this enlightens.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜